reviewing xhtml elements: block vs inline

June 11th, 2009 by Andrea Matesi 997 Views
what-is-xhtml

what-is-xhtml

Today I was reviewing some XHTML syntax. This post is a placeholder for me to remember wich ones are CSSĀ block elements and wich ones are CSS inline elements.

The difference between the two is, according to the specifications, that a block-level element can contain other elements (block-level and inline elements); an inline element can only contain one or more inline elements, but not block-level elements.

The block-level elements:

  • h1, h2, h3, h4, h5, h5
  • p
  • div
  • blockquote
  • ul and ol
  • forms

The inline elements:

  • em
  • strong
  • cite
  • a
  • img

a cool example:

<p>

<strong>

<em>

<a href="http://www.pwrusr.com/">pwrusr.com

</a>

</em>

</strong>

is a site for

<cite>power users!</cite>

</p>

an important rule: symmetry aka we have to strive to keep opening and closing tags ordered simmetrically.

Senior Professional Network and Computer Systems Engineer during work hours and father when home.

Andrea strives to deliver outstanding customer service and heaps of love towards his family.

In this Ad-sponsored space, Andrea shares his quest for "ultimate" IT knowledge, meticulously brought to you in an easy to read format.

Posted in WEB, Web Standards | Comments Off on reviewing xhtml elements: block vs inline