CSS中可继承与不可继承属性有哪些

不可继承属性

display:元素的显示模式(块级、行内元素、行内块)

文本属性

vertical-align:垂直对齐方式

text-decoration:规定添加到文本的装饰(underline-line、line-through、overline)

text-shadow:文本阴影效果

white-space:空白符的处理

unicode-bidi:设置文本的方向

盒子模型的属性

border

margin

padding

width

height

背景属性

background、background-color、background-image、background-repeat、background-position、background-attachment

定位属性

float、clear、position、top、right、bottom、left、min-width、min-height、max-width、max-height、overflow、clip、z-index

生成内容属性

content、counter-reset、counter-increment

轮廓样式属性

outline-style、outline-width、outline-color、outline

页面样式属性

size、page-break-before、page-break-after

声音样式属性

pause-before、pause-after、pause、cue-before、cue-after、cue、play-during

可继承属性

字体系列属性

font-family

font-size

font-weight(normal、bold)

font-style(normal、italic)

文本系列属性

text-align:文本水平对齐

text-indent:文本缩进

line-height:行高

word-spacing:单词之间的间距

letter-spacing:中文或者字母之间的间距

text-transform:控制文本大小写(就是uppercase、lowercase、capitalize这三个)

color:文本颜色

元素可见性

visibility:控制元素显示隐藏

列表布局属性

list-style:列表风格,包括list-style-type、list-style-image等

光标属性

cursor:光标显示为何种形态

posted @   yeqi7  阅读(78)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示