Page layout ideas

Page layout

Layout ideas

For me this beginners, floating really let me be as my first love (teeth), sometimes you make it east, west toward it, really skull hurt, so I plan to sort out ideas:

For a page layout can be divided into two cases (transverse and longitudinal)
1. The longitudinal block, each block is written to a div, because div is an exclusive line (block-level element)
2. The lateral block , then
a similar write a div each block, and each have a floating div;.
. B need to set the width of each div is required, but the parent does not exceed the sum of the width of the box.
. C is necessary to be provided their height, and the color of the background or the border, in significant visual effect, which helps debugging;
D process parent box height: div is provided for removing floating in a final position (so. parent box only "normal performance"), or the parent box overflow: hidden; or set to a fixed wrap height inside the box (the height of the box fixed inside the case is available). This is necessary.

Layout must pay attention to:

  1. Horizontally arranged need to use floating layout (left-right, two left and right, left, or both)
  2. As long as floating elements, you have to consider the problem of the parent element height, without its constraints, such that the parent element will be affected by the floating up of sub-elements, will be such that the longitudinal blocks positioned longitudinally below parent element is moved upward, thereby the parent element so that the normal display can not be
    constrained manner:
    a high fixed set;.
    B Clear float to obtain a natural high.
    • parent elements using overflow: hidden;
    last position plus additional • a parent element and set its div clear: both ;
Published 32 original articles · won praise 35 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_43932553/article/details/105033914