前端学习(64):css继承属性小结
? ? 今天來總結一點關于css中哪些屬性可以被繼承,哪些不可以被繼承。不是很全,僅供大家參考,也方便于自己以后復習。
一、不能被繼承的屬性
1、display:規定元素應該生成的框的類型
2、文本屬性:?
? ? ? ?vertical-align、 text-decoration、text-shadow 等
3、盒子模型的屬性:
? ? ? ?width、height、margin 、border、border-style、padding 等
4、背景屬性:
? ?????background、background-color、background-image、background-repeat、background-position、background-attachment 等
5、定位屬性:
? ? ? ?float、clear、position、top、left、right、bottom、overflow、z-index 等
?
二、能被繼承的屬性
1、字體系列屬性
????????font、font-family、font-weight、font-size、font-style 等
2、文本系列屬性
????????text-indent、?color、text-align、line-height、word-spacing 等
3、元素可見性:visibility
4、光標屬性:cursor
5、列表布局屬性:list-style
?
總結
以上是生活随笔為你收集整理的前端学习(64):css继承属性小结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ux的重要性_颜色在UX中的重要性
- 下一篇: 前端学习(239):渐进增强和优雅降级