开发者

css before not working in IE 8

I am using wicket framework and overriding appendOptionHtml of ListMultipleChoice to generate below select tag and using CSS :before to place red * before option text it is 开发者_开发技巧working fine in FF but not in IE.

CSS:

.required:before {
    content: "*";
    color: #8B2942;
}

HTML:

<select>
 <option class="required" value="0">test1</option>
 <option class="required" value="1">test2</option>
 <option class="required" value="2">test3</option>
</select>

Can anyone please help or any other way to put red asterisk to my option text? I have tried all DOCTYPE still not working.


The required notice belongs on the label of the select field, not the options. eg:

.required{color:#8B2942}

<label for="myselect"><span class="required">*</span> Title: </label>
<select id="myselect" name="myselect">
    <option value="1">test1/option>
    <option value="2">test2</option>
    <option value="3">test3</option>
</select>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜