简体   繁体   English

如何为未选中的antd复选框添加边框颜色

[英]how to add border color to unchecked antd checkbox

I need to add a border color and make the border thicker for antd checkbox.我需要添加边框颜色并使 antd 复选框的边框更厚。

<Checkbox>Add</Checkbox>

css: css:

.ant-checkbox-checked .ant-checkbox-inner {
    background-color: red;
    border-color: red;
}

The above code helped me changed the checkbox when only 'checked'上面的代码仅在“选中”时帮助我更改了复选框

I also tried,我也试过,

outline : 2px solid red;

How can I change the width and color of the border for a antd checkbox?如何更改 antd 复选框边框的宽度和颜色?

To change the checkbox when not checked all you have to do is use:要在未选中时更改复选框,您只需使用:

      .ant-checkbox-inner {
        width: 24px;
        height: 24px;
        border-width: 3px;
        border-radius: 5px;
        border-color: red;
      }

But to style it while it's checked :但是要在检查时对其进行样式设置:

      .ant-checkbox-checked .ant-checkbox-inner {
        background-color: blue;
        border-color: blue;
        width: 24px;
        height: 24px;
        font-size: 24px;
      }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM