acthtml
V2EX  ›  问与答

问个 css 缩写。

  •  
  •   acthtml · Sep 10, 2014 · 3711 views
    This topic created in 4447 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
    wsph123
    Sep 10, 2014❤️1
    1
    不能
    witcher42
    witcher42
    Sep 10, 2014❤️1
    2
    background: #fff url("/static/img/top_light.png") center center / 10px 10px no-repeat;
    linuxer
    linuxer
    Sep 10, 2014❤️1
    3
    background: url("../image.png") no-repeat scroll center center / 10px 10px #fff;
    acthtml
    acthtml
    OP
    Sep 10, 2014
    4
    测试了一下。用'/'分割 background-postion 和 background-size的方法可行。

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

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

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