javascript - 哪个是使用部分标签的好概念?
问题描述
我想在我的程序中使用部分标签,所以这是在程序内部使用部分标签的正确方法......
<section id="training-pg">
<div class="row">
<div class="container">
// Write you code here.
<h3>the title</h3>
<p><?php the_field('training_program'); ?></p>
</div>
</div>
</section> // Or
<div class="container-fluid">
<div class="row">
<section id="training-pg">
<h3>the title</h3>
<p><?php the_field('training_program'); ?></p>
</section>
</div>
</div>
解决方案
<select>
根据W3Schools的说法,使用的语义方式是:
部分是内容的主题分组,通常带有标题
根据MDN:
HTML
<section>
元素代表一个独立的部分——它没有更具体的语义元素来表示它——包含在 HTML 文档中。通常,但并非总是如此,部分有一个标题。
看到您的第一个示例有一个带有 ID 的部分,该部分清楚地定义了该部分的目的以及标题,我会说:
<section id="training-pg">
<div class="row">
<div class="container">
<h3>the title</h3>
<p><?php the_field('training_program'); ?></p>
</div>
</div>
</section>
是正确且最符合语义的使用方式<section>
。
推荐阅读
- python - Windows 10 Toast 通知完成后退出我的 PyQt 应用程序
- python - 短文本 Python 的主题建模
- azure-application-insights - App Insights 记录我的 kusto 函数未显示在函数列表中
- nginx - 通过 nginx 代理请求不起作用,错误 404
- javascript - 表格提交在切换点击
- excel - Excel 加载为给定单元格值分配的上一条记录
- python - 如何使用 Python 从 json 文档中提取多个字段?
- macos - PyCharm 在 MacBook Air 上意外退出
- javascript - 如何首先给 Anime.js 元素一个打开动画,然后是一个循环动画?
- reactjs - 哨兵/浏览器是否有包含参数以仅包含特定文件?