background有哪些属性

kuaidi.ping-jia.net  作者:佚名   更新日期:2024-07-10
background 中有几个属性值,分别是什么

background-color 规定要使用的背景颜色。
background-image 规定要使用的背景图像。
background-repeat 规定如何重复背景图像。
background-attachment 规定背景图像是否固定或者随着页面的其余部分滚动。
background-position 规定背景图像的位置。

一、字体属性
  与字体有关的属性包括:font-family,font-style,font-variant,font-weight,
font-size,font。执行顺序是:font-style,font-variant,font-weight,font-size
1、font-family:如果字体的名称中含有空格,那么要加上双引号。
2、font-style:normal|italic|oblique
3、font-variant:normal|small-caps
4、font-weight:normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900
  normal相当于400,bold相当于700
5、font-size:absolute-size|relative-size|length|percentage
absolute-size:xx-small|x-small|small|medium|large|x-large|xx-large
relative-size:larger|smaller
6、font:font-style|font-variant|font-weight|font-size|line-height|font-family
  font属性可以一次定义前边提到的所有的字体属性。

background-attachment:scroll | fixed scroll:背景图像是随对象内容滚动。 fixed:背景图像固定。background-color:transparent | color transparent:背景透明色。 color:指定颜色、background-image:none | url none:无背景图。 url:使用绝对或相对地址指定背景图像。background-position : length || length length :  百分数 | 由浮点数字和单位标识符组成的长度值。
background-position : position || position position :  top | center | bottom | left | center | right
background-positionX : length | left | center | right length :  百分数 | 由浮点数字和单位标识符 组成的长度值。 left :  居左 ,center :  居中 ,right :  居右
background-positionY : length | top | center | bottom length :  百分数 | 由浮点数字和单位标识符组成的长度值。left :  居左 ,center :  居中 ,right :  居右
background-repeat : repeat | no-repeat | repeat-x | repeat-y repeat :  背景图像在纵向和横向上平铺,no-repeat :  背景图像不平铺,repeat-x :  背景图像在横向上平铺,repeat-y :  背景图像在纵向平铺

Background Properties
属性CSS Version
版本Compatibility
兼容性Inherit From Parent
继承性Description
简介backgroundCSS1IE4+ , NS4+无复合属性。设置或检索对象的背景特性background-attachmentCSS1IE4+ , NS6+无设置或检索背景图像是随对象内容滚动还是固定的background-colorCSS1IE4+ , NS4+无设置或检索对象的背景颜色background-imageCSS1IE4+ , NS4+无设置或检索对象的背景图像background-positionCSS1IE4+ , NS6+无设置或检索对象的背景图像位置background-positionXIE专有属性IE5.5+无设置或检索对象的背景图像横坐标位置background-positionYIE专有属性IE5.5+无设置或检索对象的背景图像纵坐标位置background-repeatCSS1IE4+ , NS4+无设置或检索对象的背景图像是否及如何铺排layer-background-colorNS专有属性NS4+无设置或检索对象整个区域的背景颜色layer-background-imageNS专有属性NS4+无设置或检索对象整个区域的背景图像

background-color
background-position
background-size
background-repeat
background-origin
background-clip
background-attachment
background-image
给你一个网站 http://www.w3school.com.cn/css/pr_background.asp

属性有金,木水火土

参考:http://www.w3school.com.cn/css/pr_background.asp



  • CSS样式表控制背景图片大小
    答:可以通过background-size属性来设定背景图片的大小。它可以是像素(px)或者是百分比(%),举例说明:background-size:950px* 200px这表示把背景图片大小调整为宽度950像素,高度200像素。1、background-size的语法说明:(1)属性名:background-size (2)属性值:其中 bg-size = [|| auto ]{1,2} | ...
  • CSS中的background和background-color的区别
    答:区别如下:一,background可以设置背景颜色、背景图片、定位等。而background-color只能设置背景颜色 。二,底色(background-color)是纯的色区。背景(background),可以是纯色也可以是图案。三,background的属性值是图片资源,而background-color的是颜色。
  • 用记事本做简单网页设计,如何让背景图片不覆盖页面内容?
    答:①出现这种问题的原因,可能是你使用了img标签来作为背景图,这种方法不是不可以,需要设置position和z-index。②常用的方式使用背景设置background来解决 示例如下:body { background: #00FF00 url(bgimage.gif) no-repeat fixed top; } background 简写属性在一个声明中设置所有的背景属性。可以...
  • html background属性
    答:background 属性在一个声明中设置所有的背景属性。语法:Object.style.background=background-color background-image background-repeat background-attachment background-position 参数 描述 值 background-color 设置元素的背景色。color-name color-rgb color-hex transparent background-image 设置背...
  • Dw代码中插入背景图片的代码是什么?
    答:Dw代码中插入背景图片的代码的具体步骤如下:我们需要准备的材料分别是:电脑、DW。1、首先我们打开需要编辑的DW文件,点击需要插入背景图片的地方。2、然后我们点击打开主菜单栏中的“插入”中的“Image”,之后点击选择想要插入的图片。3、然后我们在弹出来的窗口中就可以看到图片的代码了。
  • background-image属性是什么?
    答:在各个背景图像层中,第一个图像层最接近屏幕前的观察者。元素的边框会被绘制在背景图像的上面,而元素的background-color(背景颜色)则会被绘制在所有背景图像的下面。background-image属性值模式 background-image的属性值模式就是用来给它加“特技”的。它的值模式有:1、url()模式;2、linear-...
  • 使用background-size如何设置背景图片的宽度和高度
    答:本篇文章给大家带来的内容是关于使用background-size如何设置背景图片的宽度和高度 ,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。使用background-size属性设置语法:background-size: length|percentage|cover|contain;length: 设置背景图像的高度和宽度。 第一个值设置宽度,第二个值...
  • body background=定义的背景图片如何居中?
    答:比较简单且有效的方法,使用css来控制图片居中。操作很简单,把如下代码加入区域中即可:又或另外一种更简单的代码,如下:background:url(111.jpg) no-repeat center center;
  • background-image属性是什么?
    答:在各个背景图像层中,第一个图像层最接近屏幕前的观察者。元素的边框会被绘制在背景图像的上面,而元素的background-color(背景颜色)则会被绘制在所有背景图像的下面。background-image属性值模式 background-image的属性值模式就是用来给它加“特技”的。background-image 属性会在元素的背景中设置一个...
  • 怎么用css中background属性截图?
    答:background-position属性分为x轴和y轴,也就是横坐标和纵坐标两个值:background-positionx和background-positiony。对于一整张大图只需要截取其中一部分,你需要知道两点:1.需要的那一部分图片的在整个大图中的位置 2.它的大小 然后就好办了,我举个小例子:一张300px*300px的大图,我需要的部分...