继承了哪些 CSS 属性?

编程入门 行业动态 更新时间:2024-10-22 07:50:23
本文介绍了继承了哪些 CSS 属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我注意到有些属性在 CSS 中是继承的,有些则不是.例如,text-size 属性是继承的,但是padding 和margin 不是由子块继承的.那么如何判断哪些属性是继承的,哪些不是呢?

I've noticed that some properties are inherited in CSS, and some are not. For example, the text-size property is inherited, but the padding and margin are not inherited by the child blocks. So how to figure out which properties are inherited, and which are not?

推荐答案

这里是所有可继承属性的列表.我正在处理 W3C 的信息,所以我猜应该是正确的.但是了解网络浏览器(特别是 IE),其中一些可能不是所有浏览器都可以继承的:

Here is the list of all inheritable properies. I'm working with W3C's information, so I'd guess it should be correct. But knowing web browsers (IE specifically), some of these might not be inheritable by all browsers:

  • 方位角
  • 边框折叠
  • 边框间距
  • 字幕端
  • 颜色
  • 光标
  • 方向
  • 海拔
  • 空单元格
  • font-family
  • 字体大小
  • 字体样式
  • font-variant
  • font-weight
  • 字体
  • 字母间距
  • 行高
  • list-style-image
  • list-style-position
  • list-style-type
  • 列表样式
  • 孤儿
  • 音高范围
  • 间距
  • 引用
  • 丰富性
  • speak-header
  • 说数字
  • 讲标点符号
  • 语速
  • 压力
  • 文本对齐
  • 文本缩进
  • 文本转换
  • 可见性
  • voice-family
  • 音量
  • 空格
  • 寡妇
  • 字间距
  • 更多推荐

    继承了哪些 CSS 属性?

    本文发布于:2023-11-17 02:18:19,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1608448.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:属性   继承了   CSS

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!