英文:
border radius is zero when use after psoudo element
问题
<input required type="number" class="form-control"><span></span>
英文:
i user bootstrap form , i want to insert *
after any input (in invalid input with red color and in valid input with green color)<br>
i have to use <span>
tag after any input to show *
<br>
but when i use <span>
and ::after
pseudo element input border radius is 0
but i want to no change border radius .
input:invalid+span::after {
content: "*";
font-size: large;
color: red;
}
input:valid+span::after {
content: "*";
font-size: large;
}
<div class="col-md-6 col-lg-4">
<div class="input-group mb-2">
<span class="input-group-text">
<i class="fa fa-user"></i>
</span>
<input required type="number" class="form-control"><span></span>
</div>
</div>
MyCode:
CodeLink
答案1
得分: 0
按照这些样式,它可以工作:
input:invalid+span::after {
content: "*";
font-size: large;
color: red;
}
input:valid+span::after {
content: "*";
font-size: large;
color: green;
}
.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
英文:
by this styles it worked
input:invalid+span::after {
content: "*";
font-size: large;
color: red;
}
input:valid+span::after {
content: "*";
font-size: large;
color: green;
}
.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论