html - 将另一个 css 类应用于元素

标签 html css

我在样式表中有以下内容:

.tab {
    background-color: #1A1A1A; 
    color: #A17749; 
    font-family: Verdana,"Helvetica Neue",Helvetica,Arial,sans-serif;
    -webkit-border-bottom-right-radius: 10px;
    -webkit-border-bottom-left-radius: 10px;
    -moz-border-radius-bottomright: 10px;
    -moz-border-radius-bottomleft: 10px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    float: right;
    padding: 7px;
    margin: 0 0 0 10px;
}

.tab .select {
    height: 55px;    
}

然后我有一个 html 文件:

<div id="content">
        <div class="tab select"><a href="#">Pricing</a></div>
...

但不知何故 css class select 没有被应用。有什么想法吗?

最佳答案

.tab .select { 需要是 .tab.select {

.tab .select { //<- applies to tag with .select class which is child of tag with .tab class

.tab.select  { //<- applies to tag with classes .tab and .select

关于html - 将另一个 css 类应用于元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9958553/

相关文章:

html - 如何使侧边栏高度依赖于内容高度?

html - 如何根据子宽度设置 div 的宽度?

jquery - 工作动画被轴边界打破了吗?

javascript - 如何在select2的选中项中显示一个图标?

javascript - javascript函数中的CSS代码

html - 删除大屏幕上封面图像和粘性页脚之间的白色间距

javascript - 没有JQ如何将图像随机放入单元格?

html - 将 CSS 移动到单独的文件使其无法运行

html - 高度为 100% 的表格不适合父级大小

html - 制作一个同级 div 来占用剩余的高度?