html - Semantic-UI UI 类的使用

标签 html css semantic-ui

使用Semantic-ui 的ui 类有什么规则?在文档中,ui 类的使用并不一致,例如定义菜单

<div class="menu">
<div class="ui menu">

最佳答案

这包含在 Glossary 中部分文档:

ui is a special class name used to distinguish parts of components from components.

For example, a list will receive the class ui list because it has a corresponding definition, however a list item, will receive just the class item.

The ui class name helps encapsulate CSS rules by making sure all 'parts of a component' are defined in context to a 'whole' component.

It also helps make scanning unknown code simpler. If you see ui you know you are looking at a component.

菜单很好地展示了这一点(来自文档的简化示例):

<div class="ui text menu">
  <div class="ui dropdown item">
    Applying
    <i class="dropdown icon"></i>
    <div class="menu">
      <div class="item">Applications</div>
      <div class="item">International Students</div>
      <div class="item">Scholarships</div>
    </div>
  </div>
</div>

外部菜单是一个实际的 UI 组件,因此同时具有 uimenu。然而,内部菜单实际上是另一个组件的一部分,即下拉菜单,因此没有 ui 类。

关于html - Semantic-UI UI 类的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40063347/

相关文章:

javascript - 从服务器向客户端发送 JSON 格式的 HTML 时,我应该转义内容吗?

html - 使用一个 CSS 选择器规则定位多个类的 child

html - 引导导航栏

css - 我怎样才能让 Chrome 和 Firefox 对待围绕 float 的表格相同?

html - <picture>标签不显示图片

jquery - 默认图标级联自定义 Jquery UI Accordion 图标

html - Div 具有相同的类,切换类

javascript - Semantic-UI 图像属性不适用于语义-ui-react

semantic-ui - 在语义用户界面中固定一行的宽度

javascript - 使用侧边栏阻止语义 UI 溢出内容