我已经定义了一个样式的所有图片:剔除一个特定的风格
img {
border-top-right-radius: 30px;
border-bottom-left-radius: 30px;
}
我想以不同的样式另一组图像。我为他们创建了一个类:
.radius {
border-radius: 10px;
}
但是,它似乎没有改变目标图像。据我所知,类选择器比元素选择器具有更高的优先级。任何建议,我哪里出错了?
我已经定义了一个样式的所有图片:剔除一个特定的风格
img {
border-top-right-radius: 30px;
border-bottom-left-radius: 30px;
}
我想以不同的样式另一组图像。我为他们创建了一个类:
.radius {
border-radius: 10px;
}
但是,它似乎没有改变目标图像。据我所知,类选择器比元素选择器具有更高的优先级。任何建议,我哪里出错了?
有无人看http://www.w3.org/TR/css3-selectors/#specificity
A selector's specificity is calculated as follows:
- count the number of ID selectors in the selector (= a)
- count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b)
- count the number of type selectors and pseudo-elements in the selector (= c)
- ignore the universal selector
例如,您可以通过使用标签+类
img.radius {
border-radius: 10px;
}
Here好文章从SM增加你的特异性
**如果你去大胆的所有文字,为什么要使用粗体?** – BoltClock