Normal flow is the way that elements are displayed in a Web page in most circumstances. All elements in HTML are inside boxes which are either inline boxes or block boxes.
In normal flow, block boxes are positioned on a page one after the other (in the order they're written in the HTML). They start in the upper left of the containing box and stack from top to bottom. The distance between each box is defined by the margins with top and bottom margins collapsing into one another.
For example, you might have the following HTML:
This is the first div. It's 200 pixels wide with a 5px margin around it.
This is a wider div.
This is a div that's a bit wider than the second one.
Each div is a block element, so it will be placed below the previous block element. Each left outer edge will touch the left edge of the containing block. Inline boxes are laid out on the page horizontally, one after the other beginning at the top of the container element. When there isn't enough space to fit all the elements of the inline box on one line, they wrap to the next line and stack vertically from there.
For example, in the following HTML:
This text is bold and this text is italics. And this is plain text.
The paragraph is a block element, but there are 5 inline elements: "This text is " "bold" " and this text is " "italics" ". And this is plain text."
View the original article here
No comments:
Post a Comment