gpt4 book ai didi

html - 覆盖子元素上的文本装饰

转载 作者:太空宇宙 更新时间:2023-11-04 16:08:38 25 4
gpt4 key购买 nike

<分区>

我想覆盖子元素中的父 css。我想给父元素加下划线,而不是给子元素加下划线。

.parent {
text-decoration: underline;
color: red;
}
.child {
color: green;
text-decoration: none !important;
}
.sub-child {
color: green;
text-decoration: none !important;
}
<div class="parent">Inside parent
<div class="child">Inside first child
<div class="sub-child">Inside 1st child of 1st child
</div>
</div>
<div class="child">Inside 2nd child
<div class="sub-child">Inside 1st child of 2nd child</div>
<div class="sub-child">Inside 2nd child of 2nd child</div>
</div>
<div class="child">
Inside 3rd child
<div class="sub-child">Insde 1st child of 3rd child</div>
</div>
</div>

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