- 主题:关于背景图片的区别!
我在网上看到了这两种定义,不知道有什么区别!
background: url(../img/icon.gif) 8px 5px no-repeat;
background: url(../img/icon.gif) no-repeat 8px 5px;
不知道有没有大侠能够解释一下8px 5px放在no-repeat前后有什么区别。
--
FROM 111.48.114.*
w3.org/TR/CSS21/colors.html#propdef-background
【 在 hjc404 的大作中提到: 】
: 我在网上看到了这两种定义,不知道有什么区别!
: background: url(../img/icon.gif) 8px 5px no-repeat;
: background: url(../img/icon.gif) no-repeat 8px 5px;
: ...................
--
FROM 111.201.26.*
看说明,第一个应该不规范哦!
【 在 shaolin 的大作中提到: 】
: w3.org/TR/CSS21/colors.html#propdef-background
--
FROM 111.48.114.*
我测试了好多遍,发现是一样的效果!
--
FROM 111.48.114.*
没区别,这是一个复合属性,浏览器会自动解析。
但是,一般编程规范会要求按第一个写法。
【 在 hjc404 的大作中提到: 】
:
: 我在网上看到了这两种定义,不知道有什么区别!
: background: url(../img/icon.gif) 8px 5px no-repeat;
: background: url(../img/icon.gif) no-repeat 8px 5px;
:
#发自zSMTH@CDU.MP
--
FROM 171.118.67.*
应该按第二种方法写!因为后面有时还要接size。
【 在 VincentGe 的大作中提到: 】
: 没区别,这是一个复合属性,浏览器会自动解析。
: 但是,一般编程规范会要求按第一个写法。
:
: ...................
--
FROM 111.48.114.*
看具体项目规范,但一般习惯是
color img pos size repeat
【 在 hjc404 的大作中提到: 】
:
: 应该按第二种方法写!因为后面有时还要接size。
: 【 在 VincentGe 的大作中提到: 】
: : 没区别,这是一个复合属性,浏览器会自动解析。
: : 但是,一般编程规范会要求按第一个写法。
#发自zSMTH@CDU.MP
--
FROM 171.118.67.*
谢谢!
【 在 VincentGe 的大作中提到: 】
: 看具体项目规范,但一般习惯是
: color img pos size repeat
:
: ...................
--
FROM 111.48.114.*
【 在 VincentGe 的大作中提到: 】
: 看具体项目规范,但一般习惯是
: color img pos size repeat
:
: ...................

这个图片就是采用背景图片实现的,这个很方便的哦!
--
FROM 111.48.114.*