以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 其他W3C规范 』  (http://bbs.xml.org.cn/list.asp?boardid=25)
----  关于 css3 里面background shorthand 问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=25&rootid=&id=72699)


--  作者:chonhust
--  发布时间:3/5/2009 6:13:00 PM

--  关于 css3 里面background shorthand 问题
规范里面定义了
<'background-image'>
|| <'background-position'>
|| / <'background-size'>
|| <'background-repeat'>
|| <'background-attachment'>
|| <'background-origin'>
|| no-clip

where ''/ <‘background-size’>‘ must occur after ’<‘background-position’>'' if both are present.

但是他的例子里面由却是 background size 出现在background position 后面, 有没有牛人给解释一下为什么?

另外,我还有个问题(10em)中的括号是什么意思阿,看他的例子好像说10em出现两次?

清大牛指点一下,谢谢

p { background: url("chess.png") (10em) gray
       40% round fixed border border}
而得到等价的
p {
    background-color: gray;
    background-position: 40% 50%;
    background-size: 10em 10em;
    background-repeat: round round;
    background-clip: border-box;
    background-origin: border-box;
    background-attachment: fixed;
    background-image: url(chess.png) }
p {
    background-color: gray;
    background-position: 40% 50%;
    background-size: 10em 10em;
    background-repeat: round round;
    background-clip: border-box;
    background-origin: border-box;
    background-attachment: fixed;
    background-image: url(chess.png) }


--  作者:admin
--  发布时间:3/5/2009 9:32:00 PM

--  
where ''/ <‘background-size’>‘ must occur after ’<‘background-position’>'' if both are present.

但是他的例子里面由却是 background size 出现在background position 后面, 有没有牛人给解释一下为什么?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~他说得很清楚: ''/ <‘background-size’>‘ 必须出现在 ’<‘background-position’>'' 之后。有什么问题吗?

em跟px,pt一样,都是长度单位。em表示字体字号。


--  作者:chonhust
--  发布时间:3/9/2009 2:21:00 PM

--  
谢谢阿

但是你再看一下他的background shorthand的例子 ,他里面的 background-size 是出现在 background-potition前面,而不是后面,而且这个例子是 css specification里面的.

第二个问题我不是文10em代表什么?
我是问(10em)这个括号是什么意思?是不是代表10em 有两个.

因为background-size有两个值,但是在background short hand 里面就用(10em),所以我不太确定括号是什么意思

能给指点一下吗?谢谢


--  作者:chonhust
--  发布时间:3/9/2009 2:26:00 PM

--  
不好意思,我最开始写得有问题,应该说例子里面 background size 出现在background position 前面


where ''/ <‘background-size’>‘ must occur after ’<‘background-position’>'' if both are present.

但是他的例子里面由却是 background size 出现在background position 后面, 有没有牛人给解释一下为什么?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~他说得很清楚: ''/ <‘background-size’>‘ 必须出现在 ’<‘background-position’>'' 之后。有什么问题吗?


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
50.781ms