美文网首页
background简写笔记

background简写笔记

作者: eks | 来源:发表于2018-05-31 10:34 被阅读30次

css设置元素背景常用的属性:

background-color                    // 背景色
background-image                  // 背景图
background-repeat                  // 如何重复背景图像,repeat/repeat-x/repeat-y/no-repeat/inherit
background-attachment          // 背景图像是否固定或者随着页面的其余部分滚动,fixed/scroll
background-position                // 背景图像的位置
background-size                      // 背景图片的尺寸

常用基本就这6个,
简写顺序就是以上顺序,如:

body{
background: aquamarine url("https://cdn2.jianshu.io/assets/web/nav-logo-4c7bbafe27adc892f3046e6978459bac.png") no-repeat fixed top center / 100px 50px;
}

这里要注意的是,position和size之间必须要斜线隔开

相关文章

  • background简写笔记

    css设置元素背景常用的属性: 常用基本就这6个,简写顺序就是以上顺序,如: 这里要注意的是,position和s...

  • CSS揭秘

    1.backgrouond简写 在background简写属性中指定background-sizing时,需要提供...

  • CSS 的 background 属性小结

    background有8个属性控制,可以简写成一个 1.background-color background-c...

  • day04(属性+表格)

    一 背景 1 背景重复 2 背景位置简写 3 背景简写 4 背景吸附 background-attachment:...

  • background系列属性

    background系列属性 background是一个简写属性,其属性值可以包括backgrund-colorb...

  • 学习笔记-CSS-2017.2.13

    一、CSS 背景 当使用简写属性时,属性值的顺序为:background-color; background-im...

  • CSS背景

    background:简写属性background-attachment:背景图像是固定或是随页面其余部分滚动ba...

  • css常用样式

    1.背景background background 简写属性,作用是将背景属性设置在一个声明中backgroun...

  • CSS background深入理解及应用

    Background background属性的简写用法, 常见背景属性的理解以及神奇的渐变色。 目录 backg...

  • CSS background深入理解及应用

    Background background属性的简写用法, 常见背景属性的理解以及神奇的渐变色。 目录 backg...

网友评论

      本文标题:background简写笔记

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