Giter Club home page Giter Club logo

Comments (4)

think2011 avatar think2011 commented on July 21, 2024

"...浮动元素会先按照正常流进行布局" 赞!

from blog.

Aaaaaaaty avatar Aaaaaaaty commented on July 21, 2024

@think2011 我一直不知道这个“坑” 所以很多对有些布局无法理解2333

from blog.

LeoWang1991 avatar LeoWang1991 commented on July 21, 2024

<div class="center">
    some content fits or there are no more floats present.
</div>
<div class="left"></div>

我一直的理解都是,浮动元素脱离了文档流!但是为什么现在没有出现在顶点呢?

为什么脱离文档流就一定要在顶点上,如果没有设置position left/top,该demo中就算把.left div设置position:absolute(不设置left/top位置)也是一样在.center元素下面。
我觉得脱离文档流的元素对其之前正常元素的位置并没有影响,对之后正常的元素定位有影响。

from blog.

Aaaaaaaty avatar Aaaaaaaty commented on July 21, 2024

@LeoWang1991 嗯是的 我之前一直没有意识到浮动元素在脱离文档流之后只会向左或者向右。所以就没有理解为啥不能向上,顶到头。至于position定位,你说的都对哈哈。重点就是这些布局先都是正常流布局,然后再脱离文档流,一个是浮动的话只能左右移动,absolute则可以通过设置topleft来随意走。只会影响后面的。谢谢指出问题!!!

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.