gpt4 book ai didi

html - 重写链中的类?

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:23 25 4
gpt4 key购买 nike

我有以下内容:

.mainClass a.customizeIt span {
background: transparent url('../images/myimage.png') no-repeat;
color: #ffffff;
display: block;
font-size: 13px;
}

是否有某种方法可以实现上述的另一个版本,从而不使用背景图像?

.mainClass a.customizeIt span {
color: #ffffff;
display: block;
font-size: 13px;
}

元素中应该如何引用第二个版本?

-- 编辑--
以下是否可行,因此没有背景,我可以重复使用颜色、显示和字体大小?

.mainClass a.customizeIt a.no-bg span {
background: none;
}

最佳答案

这是你的主旨吗?

html

<a class="customizeIt" href="#"><span>sample1</span></a>

在您要删除下面显示的背景图像的部分中使用了类 no-bg

<a class="customizeIt no-bg" href="#"><span>sample2</span></a>

CSS

.mainClass a.customizeIt span {
background: transparent url('../images/myimage.png') no-repeat;
color: #fff;
display: block;
font-size: 13px;
}

.mainClass a.no-bg span {background-image:none !important}

关于html - 重写链中的类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15647567/

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