V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
chimingphang
V2EX  ›  问与答

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

  •  
  •   chimingphang · Dec 5, 2016 · 1951 views
    This topic created in 3440 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   ·   4788 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 00:14 · PVG 08:14 · LAX 17:14 · JFK 20:14
    ♥ Do have faith in what you're doing.