chimingphang
V2EX  ›  问与答

背景层和顶部标签怎么定位的问题

  •  
  •   chimingphang · Dec 5, 2016 · 2212 views
    This topic created in 3582 days ago, the information mentioned may be changed or developed.

    text 如图,如果我背景图片是 background-size:cover; 那我顶部标签该怎么定位啊? 百分比好像还是有问题,好难,哪位大神有经验解解?

    2 replies  •  2016-12-05 17:17:44 +08:00
    SilentDepth
        1
    SilentDepth  
       Dec 5, 2016   ❤️ 1
    如果图片或容器的宽高比是无法确定的, JS 吧,确定一个长边后按百分比定位
    chimingphang
        2
    chimingphang  
    OP
       Dec 5, 2016
    @SilentDepth 太感谢你了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2354 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 00:55 · PVG 08:55 · LAX 17:55 · JFK 20:55
    ♥ Do have faith in what you're doing.