English 中文(简体)
在<div id=“header”上使用<header>是否有任何实际好处?
原标题:Is there any practical benefit of using <header> over <div id="header">?
  • 时间:2011-09-13 09:54:02
  •  标签:
  • css
  • html

Is there any practical benefit of using <header> over <div id="header">?

and writing css for header {} over #header {}

我知道一个下行,如果使用<代码><header>否则将不作作风,我将不得不惩罚印有 Java印的电子用户。

I know it s HTML5 but is there any advantage of using it until non HTML5 supported browsers are still in use.

IE6、IE7、IE8和一些老的移动浏览器不理解这些新的标签。

Edit:

它利用一个联合材料Canvas图书馆,在所有浏览器中做一些麻烦的事情,但只使用一个Javascript,在没有重大原因的情况下使用一些信标。

问题回答

Besides the fact that it gives more meaning to the markup , when working with css you can more easily select the required items without resorting to id s or class.That reduces the amount of markup you are required to write , it makes mantaining the site alot easier and help other developers understand your code better if needed.

I don t know for a fact, but I think it almost certain that using semantically better markup (e.g. <header>) will help search engine crawlers construct a better image of your website.

滚动超额5可能没有其他实际好处,甚至上述情况也不确切。 因此,在实践中,我并不真心相信你会认为,将超文本5(并做必要的额外工作,使你的网页与以前的电子版本相容)是一种良好的投资。

另一方面,如果你不关心陈旧的浏览器,那实际上就没有回落。

Well, from my point of view, it gives further meaning to the markup. At least in a more structured way. Say, for instance that you have to parse automatically your page (if it wasn t yours), you would know that the header will always be a and it doesn t depend on the CSS class used.

正如卡尔斯指出的,把更好的结构放在你的网页上——这在搜索引擎方面特别有用——它们能够更有效地把你的所有网站推上。 您可使用javascript,以获得IE承认超文本5的内容(如果发言即可将其放在内)。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签