CSS背景

作者: 叁度 | 来源:发表于2017-02-07 00:41 被阅读0次
CSS背景
  • 3D背景模型
3D背景模型
  • 属性
  • background-color
  • background-image
  • background- repeat
  • background- position
  • background-size
  • background-attachment
  • background-clip
  • background-origin
  1. background-color
    <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>

  2. background-image
    background-image: url()

  3. background- repeat
    在什么方向上重复。

/* One-value syntax */
background-repeat: repeat-x;
background-repeat: repeat-y;
background-repeat: repeat;
background-repeat: space;//调整图像间空隙来占满空间而不被裁剪
background-repeat: round;//伸缩调整图像大小占满空间而不被裁剪,没有空隙!
background-repeat: no-repeat;
/* Two-value syntax: horizontal | vertical */
background-repeat: repeat space;
background-repeat: repeat repeat;
background-repeat: round space;
background-repeat: no-repeat round;
background-repeat: inherit;
  1. background- position
    背景图上定位初始位置(左上角);
    一般和sprite图结合使用;

  2. background-size
    背景缩放:指定大小宽高、cover ;拉伸刚好占满空间、contain;缩放保持宽高比。知道宽或高触及背景区边缘;

  3. background-attachment
    背景是否跟随页面滚动

background-attachment:scroll;//默认不跟随页面滚动
background-attachment:fixed;//跟随页面滚动
  1. background-clip
    背景出现的区域:
background-clip: border-box //背景至边框以内(包括边框)
background-clip: padding-box//背景内边距以内(包括内边距下)
background-clip: content-box//背景只有内容下有
background-clip: inherit
  1. background-origin
    background-origin
    指定背景图片background-image属性的原点位置的背景相对区域.
    注意:当 background-attachment: fixed时,该属性将被忽略;
background-clip: border-box //背景图在边框以内(包括边框)
background-clip: padding-box//背景图在内边距以内(包括内边距下)
background-clip: content-box//背景图只有内容下有
background-clip: inherit

相关文章

  • CSS样式

    CSS背景 CSS字体 CSS链接 CSS 列表 CSS 表格 CSS轮廓 CSS背景 1、背景色 ba...

  • Html-CSS 背景设置

    CSS 背景 CSS 背景属性用于定义HTML元素的背景。CSS 属性定义背景效果: background-col...

  • CSS3 背景

    知识点: CSS3 背景图像区域CSS3 背景图像定位CSS3 背景图像大小CSS3 多重背景图像CSS3 背景属...

  • 整理常用CSS

    字体属性:(font) CSS文字属性: CSS边框空白 CSS符号属性: CSS背景样式: 指定背景位置 CSS...

  • CSS样式-背景(background)

    CSS样式 css背景(background) CSS 可以添加背景颜色和背景图片, 以及来进行图片设置。 背景图...

  • CSS常用的属性和值

    CSS文本 CSS字体 CSS背景

  • CSS背景

    CSS背景(background) 目标 理解背景的语法和作用CSS背景图片和插入图片的区别 应用通过CSS背景属...

  • CSS背景、文本、字体、链接、列表、轮廓

    CSS背景 CSS文本 CSS字体 CSS链接 CSS列表 CSS轮廓

  • CSS3 背景

    @(HTML5)[背景] [TOC] 三、CSS3背景 CSS背景属性回顾 背景单个属性 background-i...

  • CSS background背景

    CSS背景属性 CSS背景属性用于设置HTML元素的背景(填充),复合属性 background 可以用来设置背景...

网友评论

      本文标题:CSS背景

      本文链接:https://www.haomeiwen.com/subject/cqxpittx.html