当前位置: 代码迷 >> 综合 >> 背景background
  详细解决方案

背景background

热度:78   发布时间:2024-02-07 22:44:48.0

1. background-color:元素默认背景颜色默认值是transparent(透明的)

2. background-repeat:repeat、no-repeat、repeat-x、repeat-y

背景颜色在背景图片之下

3. background-position:背景图片在背景中的位置

background-position:x y / 方位名词 / 精确单位;

background-position:center top;(无顺序)

如果只指定了一个方位名词,另一个值省略,则这一个值默认居中对齐

background-position:right (center);

如果参数是精确单位,第一个肯定是x坐标,第二个肯定是y坐标

background-position:20px 50px;

如果只写了一个精确单位,另一个值省略,则第一个一定是x坐标的,另一个值默认居中对齐

background-position:20px (center);

如果两个值是精确单位和方位名词混合使用,第一个值一定是x坐标,第二个值一定是y坐标

 

 

  相关解决方案