How Many Ways Can Elements Relate to Each Other

Q

How Many Ways Can Elements Relate to Each Other? - CSS Tutorials - Understanding Multiple Element Formatting Rules

✍: FYIcenter.com

A

From a formatting point of view, HTML elements can relate to each other in the following ways:

  • Line up side by side - In-line elements coded next to each other are formatted side by side in a line box of a paragraph to form one line.
  • Nested as parent and child - Many block elements allows other block elements to be enclosed inside as child elements. Child elements will be formatted a single box to serve as the content box of their parent.

    in a line box of a paragraph to form one line.
  • Stack up vertically - Block elements coded next to each other are formatted as a vertical stack in a parent block element.
  • Float to edges - Elements specified with floating properties are formatted to the left edge or the right edge of the parent block element.

2007-05-11, 4801👍, 0💬