问个 css 缩写。

2014-09-10 13:47:18 +08:00
 acthtml
background : #fff url(../image.png) no-repeat center center;
background-size:10px 10px;

这个能缩写成一条不?
2750 次点击
所在节点    问与答
9 条回复
wsph123
2014-09-10 13:50:20 +08:00
不能
witcher42
2014-09-10 14:01:14 +08:00
background: #fff url("/static/img/top_light.png") center center / 10px 10px no-repeat;
linuxer
2014-09-10 14:04:49 +08:00
background: url("../image.png") no-repeat scroll center center / 10px 10px #fff;
acthtml
2014-09-10 14:22:59 +08:00
测试了一下。用'/'分割 background-postion 和 background-size的方法可行。

background : #fff url(../image.png) no-repeat center center / 10px 10px;

感谢大家,结贴。
jsonline
2014-09-10 15:00:32 +08:00
这缩写太复杂
wsph123
2014-09-10 15:23:31 +08:00
@acthtml 学习了OAQ!!!!!
kisshere
2014-09-10 15:25:09 +08:00
我现在看到css3就反感
acthtml
2014-09-16 16:39:23 +08:00
追加一个:

这些缩写在小米2,三星,4s等手机失效。
acthtml
2014-09-16 16:39:47 +08:00
所以,要兼容这些移动设备的还是分开写吧。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/132697

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX