html5 new layout elements old browsers

人盡茶涼 提交于 2019-12-23 06:49:11

问题


I have my site ( http://www.rohanjain.in) based on html5. It uses the new elements defined in html5 for page layout: header, nav, section, article, footer etc. But I just checked that with old browsers and ie (dont care about this "non" browser) dont render the page properly.

Snapshot:

The css markup (source of css at http://www.rohanjain.in/media/css/style.src.css) is not being followed maybe because it does not recognize the tags.

Currently for old browsers visitors are redirected to this and for ie this page.

Could not find a proper solution to this. Is there any workaround so that the page can be rendered properly and with html5?


回答1:


Have you looked at HTML5Shiv?




回答2:


Use the HTML 5 remy sharp script to document.createElement them:

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

http://work.arounds.org/issue/19/styling-html-5-elements-ie/

Also you have to declare display:block for all the HTML5 block level elements manually:

article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
    display:block
}


来源:https://stackoverflow.com/questions/4175050/html5-new-layout-elements-old-browsers

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