我需要一些帮助,最好是 jquery 片段。我们正在寻找的代码片段将允许我们忽略同一页面中的某些 css 类。
EX) 我们有 Header 标志 img 并且我们想忽略 img 的 css 样式,这如何实现?
CSS
img {
position: absolute;
top: 50%;
left: 35%;
width: 320px;
height: 240px;
transform: translateZ(.25px) scale(.75) translateX(-94%) translateY(-100%) rotate(2deg);
padding: 10px;
border-radius: 5px;
background: rgba(240,230,220, .7);
box-shadow: 0 0 8px rgba(0, 0, 0, .7);
}
我们想忽略第一个 img 的 css 样式并保留第二个 img 的样式,这是最好的方法吗?
最佳答案
你可以这样做:-
img:not(:first-child){
position: absolute;
top: 50%;
left: 35%;
width: 320px;
height: 240px;
transform: translateZ(.25px) scale(.75) translateX(-94%) translateY(-100%) rotate(2deg);
padding: 10px;
border-radius: 5px;
background: rgba(240,230,220, .7);
box-shadow: 0 0 8px rgba(0, 0, 0, .7);
}
关于jquery - 如何忽略网站某些部分的 CSS img 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25657611/