cssCopy to Clipboard /* Keyword values */ background-color: red; background-color: indigo; /* Hexadecimal value */ background-color: #bbff00; /* Fully opaque */ background-color: #bf0; /* Fully opaque shorthand */ background-color: #11ffee00; /* Fully transparent */ background-...
See also Multiple backgrounds The<color>data type Other color-related properties:color,border-color,outline-color,text-decoration-color,text-emphasis-color,text-shadow,caret-color, andcolumn-rule-color
background是CSS简写属性,用来集中设置各种背景属性。background可以用来设置一个或多个属性:background-color,background-image,background-position,background-repeat,background-size,background-attachment。 background将指定的背景属性设为明确给定的值,将没有指定的背景属性设为初始值。
MDN——background-color 初始值:background-color: transparent; 定义:CSS属性中的background-color会设置元素的背景色,属性的值为颜色值或关键字“transparent”,二者选其一。 是否继承属性:否 <!DOCTYPE HTML>div { margin-top: 10px; width: 80px; height: 50px; } .a { background-color: red; } .b...
The background shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. Component properties not set in the background shorthand property value declaration are set to their default valu
如果我将wrapper2的background-color: inherit;声明代码注释打开的话,那么在wrapper2和child中都会应用到wrapper1中所设置的背景颜色,这点和background-image道理相同。 background-origin 指定了背景图片原点相对于背景容器的位置,默认值为padding-box,表示和padding区域的原点对齐 ...
The background shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. Component properties not set in the background shorthand property value declaration are set to their default valu
The background shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. Component properties not set in the background shorthand property value declaration are set to their default valu
background 是一种 CSS 简写属性,用于一次性集中定义各种背景属性,包括 color, image, origin 与 size, repeat 方式等等 --- mdn 如果你相信mdn,那么从字面意义上来看,background是一个简写,实际代表的是什么没有任何指代意义,但是这也是大部分人日常使用的。 那...
可以设置的属性分别是:background-color, background-position, background-size, background-repeat, background-origin, background-clip, background-attachment,和 background-image 中间有些值缺少一两个,并没有什么问题 当然也可以分开写属性,比如下列属性,个人更喜欢分写属性 background-color 指定要使用的背景...