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

为什么 W3C 给绝对定位定这样的规则,而不是直接相对父级定位?求大神指导

  •  
  •   leeloto · May 20, 2016 · 3496 views
    This topic created in 3643 days ago, the information mentioned may be changed or developed.

    绝对定位元素的位置是相对于他最近的定位祖先元素( position 值非 static )。如果没有这样一个祖先元素,则相对于原始的容器。

    这种定位规则有什么好处?

    1 replies    2016-05-20 15:08:20 +08:00
    oott123
        1
    oott123  
       May 20, 2016
    个人觉得好处就是能够让你自己决定相对哪个元素定位。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4918 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:53 · PVG 17:53 · LAX 02:53 · JFK 05:53
    ♥ Do have faith in what you're doing.