input标签的checkbox复选框间距要怎么调整,现在的每个复选框之间间距太小了 很不美观
你可以用table,划分出tr,td,调整td的间距,然后把input放到td里面,这样比较简单,但是据说很不专业,反正教css的教案会告诉你table不是个布局工具,布局应该用div和css。
不过作为新手来说实现目的是最优先考虑的,会用什么用什么。
css margin
给每个复选框设置margin-right
复选框的样式不太好调整,可以使用input 结合label要写样式
.utm-checkbox-wrapper {
display: inline-flex;
align-items: center;
min-height: 40px;
padding: 8px 0;
margin-right: 32px;
cursor: pointer;
}
.utm-checkbox-wrapper-disabled .utm-checkbox,
.utm-checkbox-wrapper-disabled .utm-checkbox-text {
cursor: not-allowed;
color: #999;
}
.utm-checkbox-wrapper .utm-checkbox {
position: relative;
height: 16px;
/*margin-top: 4px;*/
}
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-input {
position: absolute;
left: 0;
z-index: 3;
height: 16px;
width: 16px;
margin: 0;
opacity: 0;
}
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-input:disabled {
cursor: not-allowed;
}
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-input:disabled + .utm-checkbox-inner {
border: 1px solid rgba(223, 223, 223, 1);
cursor: not-allowed;
}
.utm-checkbox-wrapper .utm-checkbox-inner {
position: relative;
display: inline-block;
height: 15px;
width: 15px;
margin: 0;
cursor: pointer;
border-radius: 2px;
background: transparent;
border: 1px solid rgba(184, 147, 87, 1);
transition: border-color .2s ease-in-out, background-color .2s ease-in-out, box-shadow .2s ease-in-out;
top: -2px;
left: 0;
}
.utm-checkbox-wrapper .utm-checkbox-indeterminate .utm-checkbox-inner,
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-input:checked + .utm-checkbox-inner ,
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-inner.utm-checkbox-inner-checked {
border-color: rgba(184, 147, 87, 1);
background-color: rgba(184, 147, 87, 1);
}
.utm-checkbox-wrapper .utm-checkbox-inner:before {
content: "";
display: table;
width: 5px;
height: 10px;
position: absolute;
top: 1px;
left: 4px;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
-webkit-transform: rotate(45deg) scale(0);
transform: rotate(45deg) scale(0);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.utm-checkbox-wrapper .utm-checkbox-indeterminate .utm-checkbox-inner:before,
.utm-checkbox-wrapper .utm-checkbox.utm-checkbox-indeterminate .utm-checkbox-input:checked + .utm-checkbox-inner:before {
width: 9px;
height: 0;
left: 2px;
top: 5px;
-webkit-transform: rotate(0deg) scale(1);
transform: rotate(0deg) scale(1);
}
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-input:checked + .utm-checkbox-inner:before ,
.utm-checkbox-wrapper .utm-checkbox .utm-checkbox-inner.utm-checkbox-inner-checked:before {
-webkit-transform: rotate(45deg) scale(1);
transform: rotate(45deg) scale(1);
}
.utm-checkbox-wrapper .utm-checkbox-text {
margin-left: 8px;
color: #333;
}
```css