What is a "span" Tag/Element?

A "span" element is an inline element that you can use a container of inline elements and text contents. By default, browsers will do nothing on "span" elements unless specify some CSS properties in them. Here are basic rules about an "span" element:

  1. "span" elements are inline elements.
  2. "span" elements can have PCDATA as contents.
  3. "span" elements can have inline elements as sub-elements.
  4. "span" elements can not have any block elements as sub-elements.
  5. A "span" element will be ignored by most browsers, unless it has some CSS properties.

No comments:

Post a Comment