我写了一个css文件
.atleastTwoChars:after {
content: "2*";
float: left;
width: 16px;
height: 14px;
border: 0;
margin: 2px 3px 0px 3px;
color: red;
}
我用过这样的
<nobr>
<input type="hidden"
name="ctl00$objContentPageTag$spzContactInformation$txt_sContactZipCode$objHidden"
id="ctl00_objContentPageTag_spzContactInformation_txt_sContactZipCode_objHidden" value="0">
<input name="ctl00$objContentPageTag$spzContactInformation$txt_sContactZipCode$objTextBox"
type="text"
id="ctl00_objContentPageTag_spzContactInformation_txt_sContactZipCode_objTextBox"
class="xqh_LookUpTextBox_Edit">
<span id="ctl00_objContentPageTag_spzContactInformation_txt_sContactZipCode_spanImgMandatory"
class="atleastTwoChars">
</span>
</nobr>
JavaScript的:
$('#ctl00_objContentPageTag_spzContactInformation_txt_sContactZipCode_spanImgMandatory')
.removeClass("xqh_LookUpTextBox_ImgMandatory")
.addClass("atleastTwoChars");
$('img[id*="txt_sContactZipCode_imgMandatory"]').remove();
问题:内容(2 *)应显示在文本框的末尾,但它会像这样在开头显示。
答案 0 :(得分:2)
答案 1 :(得分:1)
float: left;
将显示在行的开头。也许您想要使用display: inline-block;
。或者只是删除浮动,高度和宽度。