IE11 Ignoring Inline CSS

走远了吗. 提交于 2020-01-06 02:25:15

问题


Site being developed here: http://new.brushman.com/about/

The CMS allows adding of in-line CSS on a page by page basis. This CSS is added to the page after all other .css files are loaded.

IE11 is ignoring the style, even-though it works in 8, 9, 10, Edge, and all the rest (Chrome, Firefox, Safari, etc)

The inline CSS is:

<style>
/* CMS Page about CSS */
main {background: #d70055;}
</style>

and is in the after all the css files are loaded

The interesting thing is that inspect element shows the background with a checkmark, and it's at the top of the list indicating it has the highest priority.

There are no opaque elements covering the element.

Some things I've tried: !important removing the comments adding additional new lines using rgba

Completely and thoroughly stumped.


回答1:


This should work:

main {
    display: block;
    background: #d70055;
}

IE does not treat unknown types of elements as block elements - just like the <main> element in this case.




回答2:


Unfortunatley IE11 does not support the new <main> html semantic element.



来源:https://stackoverflow.com/questions/33743793/ie11-ignoring-inline-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!