V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
acthtml
V2EX  ›  问与答

问个 css 缩写。

  •  
  •   acthtml · Sep 10, 2014 · 3301 views
    This topic created in 4248 days ago, the information mentioned may be changed or developed.
    background : #fff url(../image.png) no-repeat center center;
    background-size:10px 10px;

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

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

    感谢大家,结贴。
    jsonline
        5
    jsonline  
       Sep 10, 2014 via Android
    这缩写太复杂
    wsph123
        6
    wsph123  
       Sep 10, 2014
    @acthtml 学习了OAQ!!!!!
    kisshere
        7
    kisshere  
       Sep 10, 2014
    我现在看到css3就反感
    acthtml
        8
    acthtml  
    OP
       Sep 16, 2014
    追加一个:

    这些缩写在小米2,三星,4s等手机失效。
    acthtml
        9
    acthtml  
    OP
       Sep 16, 2014
    所以,要兼容这些移动设备的还是分开写吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5620 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 09:11 · PVG 17:11 · LAX 02:11 · JFK 05:11
    ♥ Do have faith in what you're doing.