gpt4 book ai didi

css - 父子css关系?

转载 作者:行者123 更新时间:2023-11-28 08:19:38 25 4
gpt4 key购买 nike

是否可以在父级的 css 中编写子级 css? the fiddle

-之前-

table.header {
line-height:32px;
background-color:#1BA7F5;
color:#FFF;
}

table.header th {
padding-left:10px;
text-align:left;
font-weight: normal;
}

-After-(我已经尝试了下面的但它不起作用)

table.header {
line-height:32px;
background-color:#1BA7F5;
color:#FFF;
th {
padding-left:10px;
text-align:left;
font-weight: normal;
}
}

提前致谢!

最佳答案

在纯 CSS 中这是不可能的。如果您在标题标签上设置了一个类,您可以使用单个选择器来定位它们。

使用类似于 less 的东西,你可以这样做:

table.header {
line-height:32px;
background-color:#1BA7F5;
color:#FFF;
th {
padding-left:10px;
text-align:left;
font-weight: normal;
}
}

关于css - 父子css关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28825143/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com