我有以下CSS单选按钮,但它们没有对齐到右侧。 我想知道如何正确地水平和垂直对齐较小圆形与较大圆形。
.container {
position: absolute;
z-index: 10;
display: -ms-flexbox;
display: flex;
align-items: center;
left: 1.25rem!important;
}
.radio-group__fieldset {
border: none;
padding: 0;
}
.radio-group__options__container {
display: flex;
}
.radio__container {
margin-bottom: 0;
position: relative;
}
.radio__container input[type=radio] {
position: absolute;
cursor: pointer;
left: 0;
top: 0;
z-index: 1;
margin: 0;
zoom: 1;
opacity: 0;
}
.radio__container input[type=radio]:checked+label::after {
opacity: 1;
}
.radio__container label {
position: relative;
font-weight: 400;
color: inherit;
display: -ms-flexbox;
display: flex;
align-items: center;
font-size: 1.25rem;
}
.radio__container label::before {
content: "";
border: 3px solid #0065bd;
border-radius: 50%;
}
.radio__container label::after {
content: "";
position: absolute;
background-color: #0065bd;
border: none;
text-align: center;
border-radius: 50%;
opacity: 0;
}
.radio__inline label {
margin-right: 0.625rem;
}
.radio__container.radio__inline label .radio__content {
margin-left: 0.625rem;
}
.radio__container.radio__small input[type=radio],
.radio__container.radio__small label::after,
.radio__container.radio__small label::before {
width: 13px;
height: 13px;
}
.radio__container.radio__small label::before {
border-width: 2px;
border-radius: 50%;
}
.radio__container.radio__small label:after {
transform: scale(0.8);
}
.radio__content {
display: inline-block;
vertical-align: middle;
position: relative;
top: 10%;
}
<div class="container">
<fieldset class="radio-group__fieldset undefined">
<div class="radio-group__options__container pan-zoom-tree__dependency-filter">
<div class="radio__container radio__small radio__inline">
<input id="depndency-view-0" name="depndency-view" type="radio" value="Activities" checked="">
<label for="depndency-view-0">
<div class="radio__content">Activities</div>
</label>
</div>
<div class="radio__container radio__small radio__inline">
<input id="depndency-view-1" name="depndency-view" type="radio" value="Suppliers">
<label for="depndency-view-1">
<div class="radio__content">Suppliers</div>
</label>
</div>
</div>
</fieldset>
</div>
.radio__container label::after
上添加left: 2px
。 - kukkuz