html - 不是所有的 CSS 属性都可以向下级联,或者某些标签会忽略父级的属性?

标签 html css

我的 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

来源:impressivewebs.com/

关于html - 不是所有的 CSS 属性都可以向下级联,或者某些标签会忽略父级的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16075211/

相关文章:

html - 小于浏览器高度时垂直居中 div (Bootstrap)

css - 占位符文本不适合输入区域

jquery - 如何确保冗余 <p> 标签不会破坏样式?

javascript - JQuery DataTable 不采用样式

javascript - 我可以禁用用户字体大小配置吗?

javascript - .change() Jquery 不工作

jquery - 如何让div在下拉菜单中按下另一个div

javascript - HTML 和 Javascript 代码问题

html - 在 Markdown 中添加后备图像

javascript - jQuery 查找子级并按顺序赋值