• <legend id='OFrJB'><style id='OFrJB'><dir id='OFrJB'><q id='OFrJB'></q></dir></style></legend>
      <bdo id='OFrJB'></bdo><ul id='OFrJB'></ul>
  • <tfoot id='OFrJB'></tfoot>
  • <i id='OFrJB'><tr id='OFrJB'><dt id='OFrJB'><q id='OFrJB'><span id='OFrJB'><b id='OFrJB'><form id='OFrJB'><ins id='OFrJB'></ins><ul id='OFrJB'></ul><sub id='OFrJB'></sub></form><legend id='OFrJB'></legend><bdo id='OFrJB'><pre id='OFrJB'><center id='OFrJB'></center></pre></bdo></b><th id='OFrJB'></th></span></q></dt></tr></i><div id='OFrJB'><tfoot id='OFrJB'></tfoot><dl id='OFrJB'><fieldset id='OFrJB'></fieldset></dl></div>

    <small id='OFrJB'></small><noframes id='OFrJB'>

      1. 我应该使用 &lt;section&gt;&lt;aside&gt; 内的标签?

        时间:2023-07-31
            <tbody id='vht6R'></tbody>
        • <legend id='vht6R'><style id='vht6R'><dir id='vht6R'><q id='vht6R'></q></dir></style></legend>

        • <tfoot id='vht6R'></tfoot>

            <i id='vht6R'><tr id='vht6R'><dt id='vht6R'><q id='vht6R'><span id='vht6R'><b id='vht6R'><form id='vht6R'><ins id='vht6R'></ins><ul id='vht6R'></ul><sub id='vht6R'></sub></form><legend id='vht6R'></legend><bdo id='vht6R'><pre id='vht6R'><center id='vht6R'></center></pre></bdo></b><th id='vht6R'></th></span></q></dt></tr></i><div id='vht6R'><tfoot id='vht6R'></tfoot><dl id='vht6R'><fieldset id='vht6R'></fieldset></dl></div>

            <small id='vht6R'></small><noframes id='vht6R'>

                <bdo id='vht6R'></bdo><ul id='vht6R'></ul>

                • 本文介绍了我应该使用 &lt;section&gt;&lt;aside&gt; 内的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有这样的标记:

                  <aside>
                      <div class="widget">
                          <h2>Latest news</h2>
                          <ul>...</ul>
                          <a>more news</a>
                      </div>
                      <div class="widget">
                          <h2>Choose site theme</h2>
                          <input type="select" />
                      </div>
                      <div class="widget">
                          <h2>Newsletter subscription</h2>
                          <form>...</form>
                      </div>
                      <div class="widget">
                          <h2>Related articles</h2>
                          <ul>...</ul>
                      </div>
                  </aside>
                  

                  这里哪个标签更合适:<div>还是<section>?
                  部分是否应该只在 <article> 标记内使用,而不能在 <aside> 内使用?

                  Which tag is more appropriate here: <div> or <section>?
                  Is section supposed to be used only inside <article> tag and never inside <aside>?

                  推荐答案

                  HTML 5 规范不禁止您在 aside 元素内使用 section 元素.aside 元素允许在里面有流内容,并且包括 section 元素.

                  The HTML 5 spec does not prohibit you from using the section element inside of an aside element. The aside element is allowed to have flow content inside, and that includes the section element.

                  然而,即使 div 元素现在在 HTML5 中被认为是最后的手段"的分段元素,在这种情况下使用 section 与元素的意图.从我们看到的规范来看:

                  However, even though the div element is now, in HTML5, supposed to be the sectioning element of "last resort", using section in this context goes against the intent of the element. From the spec we see:

                  注意:section 元素不是通用容器元素.当一个元素仅用于样式目的或为了方便编写脚本时,鼓励作者使用 div 元素.一般规则是,仅当元素的内容将在文档的大纲中明确列出时,section 元素才是合适的.

                  Note: The section element is not a generic container element. When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element's contents would be listed explicitly in the document's outline.

                  现在,旁白的小部分"绝对不属于整个文档的大纲,所以对您的问题的简短回答是使用 div.或者,因为你的 side 看起来里面有四个项目",你可以考虑一个带有四个 liul,然后使用规则 aside ul li 设置样式.

                  Now, little "sections" of an aside are definitely not something that belong in the outline of the entire document, so the short answer to your question is to use div. Alternatively, because your aside looks like it has four "items" inside, you might consider a ul with four lis and then style with the rule aside ul li.

                  这篇关于我应该使用 &lt;section&gt;&lt;aside&gt; 内的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:更改#hash 标记以链接页面加载 下一篇:内联 SVG &lt;标题&gt;&lt;描述&gt;可访问性的正确用法

                  相关文章

                    <bdo id='4hNXB'></bdo><ul id='4hNXB'></ul>

                  <small id='4hNXB'></small><noframes id='4hNXB'>

                  1. <legend id='4hNXB'><style id='4hNXB'><dir id='4hNXB'><q id='4hNXB'></q></dir></style></legend>
                    <i id='4hNXB'><tr id='4hNXB'><dt id='4hNXB'><q id='4hNXB'><span id='4hNXB'><b id='4hNXB'><form id='4hNXB'><ins id='4hNXB'></ins><ul id='4hNXB'></ul><sub id='4hNXB'></sub></form><legend id='4hNXB'></legend><bdo id='4hNXB'><pre id='4hNXB'><center id='4hNXB'></center></pre></bdo></b><th id='4hNXB'></th></span></q></dt></tr></i><div id='4hNXB'><tfoot id='4hNXB'></tfoot><dl id='4hNXB'><fieldset id='4hNXB'></fieldset></dl></div>

                      <tfoot id='4hNXB'></tfoot>