[英]How to use antd divider to separate two sides of the screen in a react component?
[英]How to set Antd Divider colour
我試過設置樣式顏色、背景顏色和邊框顏色。 所有不工作的分隔線仍然使用默認顏色。 有小費嗎?
import {Divider } from "antd";
<Divider style={{ color: "#d8d8d8" }}>or</Divider>
<Divider style={{ backgroundColor: "#d8d8d8" }}>or</Divider>
<Divider style={{ borderColor: "#d8d8d8" }}>or</Divider>
基本上將此添加到自定義 css 作品
.ant-divider-horizontal.ant-divider-with-text-center::before,
.ant-divider-horizontal.ant-divider-with-text-center::after
{
border-top: 1px solid red;
}
您需要使用ant-divider
class 來覆蓋分隔器的顏色,它應該像
.ant-divider{
background-color: red;
}
或者你可以像這樣使用它
<Divider style={{'background-color':'blue'}}/>
請在此處查看工作示例演示
您可以將樣式應用於分隔符組件。 像borderLeft
這樣的屬性應該可以正常工作。
<Divider style={{ borderLeft: '1px solid red' }} />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.