在我的 CSS 中,我定义了以下内容:
.required:before
{
content: "*";
font-weight: bold;
color: Red;
}
以及我认为的以下内容:
<div class="editor-label required">
Customer Group
</div>
<div class="editor-field">
@Html.DropDownList("GroupId", "")
@Html.ValidationMessageFor(Function(model) model.GroupId)
</div>
但是当我运行 View 时,它会在标签的下一行放置一个星号,我希望它们在同一行。有什么想法吗?
最佳答案
......................................................
HI 现在这样定义位置
做这个CSS
.required:before
{
content: "*";
font-weight: bold;
color: Red;
position:absolute;
left:0;
top:0;
}
.required{
position:relative;
padding-left:10px;
}
根据您的设计向左或向上调整
关于html - CSS 添加的字符后的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12639488/