简体   繁体   中英

Site css compatibility with IE 7 not working

Thanks for checking out my post. I am currently re-skinning a html5 template for my employer and have noticed while doing a bit of QA that the site appears to come out completely wrong on ie7 and 8. It seems as if the css styles are not even being pushed to the page.

here is my test link: http://daniloportal.com/NPC/index.html

I have added a couple of ifIE7 ifIE8 lines to my head but doesn't seem to do the trick. Im a newbie when it comes to ie compatibility fix's - any help is GREATLY appreciated.

Thanks! D

You're just missing a doctype ( <!DOCTYPE html> ) at the top of your file.

This just triggers IE to go into Quirks Mode which causes all sorts of problems. Put the doctype at the top of your file and make sure no-white space or comment precedes it.

Put Doctype and place IE condition at top

<!--[if lt IE 7 ]> <html class="ie6" lang="en" xml:lang="en" dir="ltr"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7" lang="en" xml:lang="en" dir="ltr"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8" lang="en" xml:lang="en" dir="ltr"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9" lang="en" xml:lang="en" dir="ltr"> <![endif]-->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM