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:光标显示为何种形态
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端