html i兼容性,我可以使用哪些HTML5标签,而不用担心浏览器兼容性?(Which HTML5 tags can I use without worrying about browser comp...

You asked what HTML5 tags to stay away from.

Well Some of the tags from HTML5 from my knowledge were made for semantic reasons. like the following for example.

..ect

These are almost fine to work with, and just require a bit of CSS eg. display: block; to work normally in most browsers, though in older browsers ie. Internet Explorer you are required to create a element in Javascript in order for it to be compatible.

Here is an example.

document.createElement('article');

Would set the element up for use in older Internet Explorer.

For more advanced HTML5 tags that require Javascript functionality to work are some like the following.

And most importantly

These elements are harder to support/shiv in older browsers. Although I have included a link to cross browser polyfills at the bottom, although I haven't personally investigated them.

So I would say that any element that doesn't require Javascript functionality are perfectly fine to use with a tiny bit of cross browser support code.

If your targeting >IE8 then you should be fine if you use a shiv.

What do I call older browsers? < IE9

Browser support for HTML5 tags today is.

, , , , ,

,

,
, ,

Are not supported by Internet Explorer less than 8 but can be fixed like this.

CSS:

section, article, aside, header, footer, nav, figure, figcaption{

display: block;

}

time, mark {

display: inline-block;

}

Javascript:

var elements = ['section', 'article', 'aside', 'header', 'footer', 'nav', 'figure', 'figcaption', 'time', 'mark'];

for( var i = 0; i < elements.length; i++ ) {

document.createElement(elements[i]);

}

And are not supported in < IE 9

The element has partial support in > IE8

You should also look into this tag.

This meta tag tells Internet Explorer to display the page in highest IE mode available, instead of going into compatibility mode and rendering the page as IE7 or 8 would do. More info on that Here.

HTML5 Helper Links

For a Kick Start you can check out

For browser compatibility support tables you can check out -

Update

As mentioned in a comment

Be careful with the meta tag X-UA-Compatible. If you use something like html5 boilerplate that has conditional comments surrounding the element (this also happens with the html5 doctype IIRC), you may run into problems with IE9 forcing itself into IE7 standards mode even with the tag. IE strikes again

You may want to look into this, I have nothing to back this up at the moment.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值