CSS關於相對定位和絕對位置的說明執行個體_CSS/HTML

來源:互聯網
上載者:User



A:均不設定postion,一般嵌套關係



B:僅外div設定relative,一般嵌套關係



C:僅內div設定absolute,文檔中為嵌套關係,頁面中內div浮起[非float],相對於頁面定位,與外div無關。




A:均不設定postion,一般嵌套關係



B:僅外div設定relative,一般嵌套關係



C:僅內div設定absolute,文檔中為嵌套關係,頁面中內div浮起[非float],相對於頁面定位,與外div無關。



D:外div設定relative,內div設定absolute,內div浮起來並相對於外div定位




D:外div設定relative,內div設定relative,內div浮起來並相對於外div定位



E:這個是說明邊界問題。-10 != 反向10px間距

  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.