V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
acthtml
V2EX  ›  问与答

问个 css 缩写。

  •  
  •   acthtml · 2014-09-10 13:47:18 +08:00 · 2743 次点击
    这是一个创建于 3508 天前的主题,其中的信息可能已经有所发展或是发生改变。
    background : #fff url(../image.png) no-repeat center center;
    background-size:10px 10px;

    这个能缩写成一条不?
    9 条回复    2014-09-16 16:39:47 +08:00
    wsph123
        1
    wsph123  
       2014-09-10 13:50:20 +08:00   ❤️ 1
    不能
    witcher42
        2
    witcher42  
       2014-09-10 14:01:14 +08:00   ❤️ 1
    background: #fff url("/static/img/top_light.png") center center / 10px 10px no-repeat;
    linuxer
        3
    linuxer  
       2014-09-10 14:04:49 +08:00   ❤️ 1
    background: url("../image.png") no-repeat scroll center center / 10px 10px #fff;
    acthtml
        4
    acthtml  
    OP
       2014-09-10 14:22:59 +08:00
    测试了一下。用'/'分割 background-postion 和 background-size的方法可行。

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

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

    这些缩写在小米2,三星,4s等手机失效。
    acthtml
        9
    acthtml  
    OP
       2014-09-16 16:39:47 +08:00
    所以,要兼容这些移动设备的还是分开写吧。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1189 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:14 · PVG 07:14 · LAX 16:14 · JFK 19:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.