加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 你可以在元素中使用元素吗?

发布时间:2020-12-14 21:36:28 所属栏目:资源 来源:网络整理
导读:我正在使用HTML5和WAI-ARIA来改进HTML中的可访问性。 可以进行以下设置吗? !-- main content --section id="main" role="main" h1The main content/h1 !-- This div needs to be here for styling reasons -- div class="the-content" pAll the text that g
我正在使用HTML5和WAI-ARIA来改进HTML中的可访问性。

可以进行以下设置吗?

<!-- main content -->
<section id="main" role="main">
    <h1>The main content</h1>

    <!-- This div needs to be here for styling reasons -->
    <div class="the-content">    
         <p>All the text that goes with the main content</p>
    </div>

    <!-- the sidebar -->
    <aside id="sidebar" role="complementary">
        <h2>A title</h2>
        <p>Some text</p>
    <aside>
</section>

我不知道的是,如果我应该有< aside> < section>之外的元素和role =“main”容器。这很重要吗

解决方法

没关系是的。在哪里放置它是由aside标签中的内容与主要部分的关系来定义的。

例如:

如果内容与主要文章有关,则应在主要内容之内。但是,如果侧边栏旁边标签的内容与主要不同,我将把它放在主要部分之外

http://html5doctor.com/aside-revisited/

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读