Block-Level vs. Inline Elements

来源:互联网 发布:编程开发软件 编辑:程序博客网 时间:2024/05/22 14:13

http://www.ahuka.com/?page_id=119

A block-level element is an HTML tag (such as ptableh1 or div) that generates a break line. A block-level element has five spacing properties: heightwidthmarginborder and padding. An inline element, such as a span or anchor, doesn’t generate a break line and isn’t as flexible a container as a block-level element.A block-level element is not allowed inside an inline element. ... Top of the hierarchy is the div
tag. This tag can contain any other block-level element. But you cannot contain div inside another block-level element.

A partial list of each type of element

With the clues we now have, let’s compile a partial list of the elements on
each type. First, the block-level elements:

  • div
  • h1…h6
  • p
  • ul
  • ol
  • li
  • table
  • tr
  • td
  • th
  • blockquote

Now, the inline elements:

  • i
  • b
  • a href
  • a name
  • em
  • strong
  • q