这个HTML5< address>有什么问题元件? [英] What is wrong with this HTML5 <address> element?

查看:94
本文介绍了这个HTML5< address>有什么问题元件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<div id="header-container">
      <address>
        <ul>
            <li>lorem ipsum</li>
            <li>(xxx) xxx-xxxx</li>
        </ul>
    </address>
</div>

CSS看起来像这样:

And the CSS looks like this:

#header-container address {float: right; margin-top: 25px;}

加载页面时,Chrome& IE,但在Firefox中它完全忽略了样式。当我在firefox查看源代码看起来像上面,但在Firebug它看起来像这样:

When I load the page, it looks fine in Chrome & IE, but in Firefox it's ignoring the styling completely. When I view source in firefox it looks like above, but in Firebug it looks like this:

<div id="header-container">
    <address> </address>
    <ul>
         <li>lorem ipsum</li>
         <li>(xxx) xxx-xxxx</li>
    </ul>
</div>


推荐答案

HTML5仍是草稿。 Firefox 3.6尚未完全支持HTML5。

HTML5 is still a draft. Firefox 3.6 doesn't completely support HTML5 yet.

根据 HTML4 spec address 只能包含 inline 元素:

<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
<!ATTLIST ADDRESS
  %attrs;                              -- %coreattrs, %i18n, %events --
  >

这是为什么Firefox认为它无效并且您的分页符。

This is why Firefox considers it invalid and your page breaks.

这篇关于这个HTML5&lt; address&gt;有什么问题元件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆