我的 HTML
<div class="teaser">
<img src="smiley.gif">
</div>
在我的 CSS 中,我尝试将 border-radius: 100% 应用到图像,使其看起来像一个圆圈。当我做的时候
.teaser{ 边界半径:100%; }
它不会工作但是 .teaser img{ border-radius: 100%;
会的。
原因是什么?是因为 border-radius 属性不能向下级联还是因为 img 标签会忽略父属性。
最佳答案
默认继承的属性
border-collapse
border-spacing
caption-side
color
cursor
direction
empty-cells
font-family
font-size
font-weight
font-style
font-variant
font
letter-spacing
list-style-type
list-style-position
list-style-image
list-style
line-height
orphans
page-break-inside
quotes
text-align
text-indent
text-transform
visibility
white-space
widows
word-spacing
关于html - 不是所有的 CSS 属性都可以向下级联,或者某些标签会忽略父级的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16075211/