html - CSS 语言讲 : Container vs Wrapper?

标签 html css

容器和包装器有什么区别?每个是什么意思?

最佳答案

根据 this回答:

In programming languages the word container is generally used for structures that can contain more than one element.

A wrapper instead is something that wraps around a single object to provide more functionalities and interfaces to it.

这个定义与单词的含义相匹配,它对 HTML 结构很有用,例如:

<ul class="items-container">
    <li class="item-wrapper">
        <div class="item">...</div>
    </li>
    <li class="item-wrapper">
        <div class="item">...</div>
    </li>
    <li class="item-wrapper">
        <div class="item">...</div>
    </li>
    <li class="item-wrapper">
        <div class="item">...</div>
    </li>
    <li class="item-wrapper">
        <div class="item">...</div>
    </li>
</ul>

关于html - CSS 语言讲 : Container vs Wrapper?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4059163/

相关文章:

html - 如果为 "too exact",则选择不起作用

html - 没有滚动条的滚动元素与CSS

wordpress - CSS 中的横向和纵向图像尺寸

CSS解密背景速记

php - Facebook 评论随机图片

javascript - 单击按钮时如何显示隐藏列

html - 使用显示 : table 在 div 内居中 div

jquery - nl2br jQuery 函数从每一行中删除字符

javascript - 继续图像的滚动效果吗?

html - 如何用颜色创建叠加效果