acthtml
V2EX  ›  问与答

问个 css 缩写。

  •  
  •   acthtml · Sep 10, 2014 · 3379 views
    This topic created in 4287 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   ·   2931 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 06:44 · PVG 14:44 · LAX 23:44 · JFK 02:44
    ♥ Do have faith in what you're doing.