jmyz0455
V2EX  ›  CSS

background-size 可以写进 background 里面吗?

  •  
  •   jmyz0455 · Oct 10, 2016 · 3464 views
    This topic created in 3532 days ago, the information mentioned may be changed or developed.

    习惯在 background 写一堆属性,但是 CSS3 新增的属性 background-size 怎么写进 background 里面呢?

    2 replies    2016-10-10 16:58:37 +08:00
    droiz
        1
    droiz  
       Oct 10, 2016
    background-position 和 background-size 之间用 / 分开。
    例如 30px 40px / 20px 30px
    yangg
        2
    yangg  
       Oct 10, 2016
    目前来说,为了兼容性,不建议合并,大概记得以前用 的 iphone 4s 还是 4 来着,不支持合并的缩写,
    所以现在 cleancss 的压缩工具都有 backgroundSizeMerging 选项配置, https://github.com/jakubpawlowicz/clean-css#how-to-set-a-compatibility-mode
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3215 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:44 · PVG 11:44 · LAX 20:44 · JFK 23:44
    ♥ Do have faith in what you're doing.