chimingphang
V2EX  ›  问与答

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

  •  
  •   chimingphang · Dec 5, 2016 · 1964 views
    This topic created in 3445 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   ·   Solana   ·   5505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 09:27 · PVG 17:27 · LAX 02:27 · JFK 05:27
    ♥ Do have faith in what you're doing.