html - 表示 UI 小部件的语义 HTML 元素

标签 html widget semantic-markup

HTML 中是否有表示 UI 小部件的元素?

我想知道是否有任何语义 HTML 元素是为可拖动时钟、天气预报或地址簿联系人等小部件设计的?

我不确定 <aside>对交互式 UI 元素有意义,以及是否 <dialog>用于模态对话框以外的任何东西,或者我是否应该坚持 <section>甚至 <div> .

最佳答案

是的,有:根据定义, <article> 元素是为表示界面小部件而设计的。

W3C specifies :

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be ( … ) an interactive widget or gadget, or any other independent item of content.

这很适合 Wikipedia definition of “widget” :

  • a generic type of software application comprising portable code intended for one or more different software platforms
  • a reusable element of a graphical user interface

关于html - 表示 UI 小部件的语义 HTML 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32657720/

相关文章:

php - 如何循环$_GET获取所有数据

javascript - 标签过滤器列表

android - 如何在 Android 中更改 Button 小部件的文本?

jquery - 仅针对父表添加 thead 并从 tbody 插入第一个 tr

javascript - Bootstrap 下拉菜单不起作用

php - 从数据库中提取图像路径并显示图像

dojo - 复制 dijit 小部件而不是重新创建它

css - Yii2 - DetailView 小部件向左浮动

html - 为什么 W3C 建议将输入元素包装在 <p> 标签中?

html - w3c html 验证错误 - 部分缺少标题。考虑使用 h2-h6 元素为所有部分添加标识标题