4

Are there any disadvantages (aside from muddier code) to using empty elements on a page simply for styling purposes?

For instance, using some empty <div>s with different texture background images to lie fixed behind page content.

The obvious one is that you're technically blurring the separation between structure and presentation layers. If I'm ok with that aspect of it, I'm just wondering if this poses any SEO, performance, or other issues.

Any links or evidence that point me in either direction would be great! Thanks!

4

1 回答 1

3

从语义上讲,我认为不会。如果只是一些空元素。但是,与其使用空的 DIV 来显示多个背景,为什么不直接使用 CSS3 的背景和边框模块呢?在这个 3 级模块中,您可以为一个元素指定多个背景,我假设您的情况是 body 元素。

您可以在此处了解更多信息:http ://www.sitepoint.com/mastering-css3-multiple-backgrounds/

有关 DIV 元素及其与 SEO 的相关性的更多信息,请查看此链接:http ://blog.ucvhost.com/advantages-of-div-tag-from-seo-prospective

于 2012-11-01T14:27:32.430 回答