How can I get IE8 to accept a CSS :before tag?

前端 未结 3 2045
独厮守ぢ
独厮守ぢ 2020-12-15 10:24

I have the following CSS code

.editable:before {
    content: url(../images/icons/icon1.png);
    padding-right:5px;
}

this is used in conj

3条回答
  •  没有蜡笔的小新
    2020-12-15 11:07

    Actually you should be careful here and read the detail. For full details, see this link - which states

    In Windows Internet Explorer 8, as well as later versions of Windows Internet Explorer in IE8 Standards mode, only the one-colon form of this pseudo-element is recognized—that is, :before. Beginning with Windows Internet Explorer 9, the ::before pseudo-element requires two colons, though the one-colon form is still recognized and behaves identically to the two-colon form.

    Meaning for browsers - you must use :before and for >=IE9 - you must use ::before

提交回复
热议问题