gpt4 book ai didi

html - 覆盖跨度样式

转载 作者:行者123 更新时间:2023-11-28 16:53:27 24 4
gpt4 key购买 nike

我是 CSS 新手!

我想使用外部 CSS 覆盖 span 样式。有什么建议吗?

!important 对我不起作用。下面的示例代码。

 <div class="abc" id= "xy" style="font-size: 30px;">
<span style="color: #009530;">bcdefghijklmnopqrstuvwxyz bananaaa</span> </div>

基本上,我想使用外部 CSS 覆盖文本的#009530。

我试过像下面的外部CSS。它对我不起作用。

  #xy {
color: blue !important;
}

TIA

最佳答案

使用以下 CSS:

#xy span{
color: blue !important;
}
<div class="abc" id="xy" style="font-size: 30px;">
<span style="color: #009530;">bcdefghijklmnopqrstuvwxyz bananaaa</span>
</div>

关于html - 覆盖跨度样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32479313/

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