V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Can I use?
http://caniuse.com/
Less
http://lesscss.org
Cool Libraries
Bootstrap from Twitter
Jetstrap
jmyz0455
V2EX  ›  CSS

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

  •  
  •   jmyz0455 · 2016-10-10 16:14:05 +08:00 · 2936 次点击
    这是一个创建于 2726 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    2 条回复    2016-10-10 16:58:37 +08:00
    droiz
        1
    droiz  
       2016-10-10 16:18:30 +08:00
    background-position 和 background-size 之间用 / 分开。
    例如 30px 40px / 20px 30px
    yangg
        2
    yangg  
       2016-10-10 16:58:37 +08:00
    目前来说,为了兼容性,不建议合并,大概记得以前用 的 iphone 4s 还是 4 来着,不支持合并的缩写,
    所以现在 cleancss 的压缩工具都有 backgroundSizeMerging 选项配置, https://github.com/jakubpawlowicz/clean-css#how-to-set-a-compatibility-mode
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1547 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:13 · PVG 01:13 · LAX 10:13 · JFK 13:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.