Container identifies the start and the ending points of the article. HTML supports two following types of containers.
The containers does not actually format the included elements. They just group them as a unit and allow to apply a specific style to all the contained elements.
The <div> tag is used to group blocks of text such as paragraphs, block quotes, headings, or lists. Other examples include all possible tags that force the browser to start a new line of text.
In contrast to the above, the <span> tag is used to contain inline elements such as individual letters, words, phrases, of inline images.
Example:
Assuming the following style definition in the header of this document:
<style type="text/css"> .intro {color:white; background-color:blue; text-align:justify; text-indent:1cm} .title {color:yellow; font-weight:900} </style> |
... the following HTML produces the result shown below.
<div class="intro"> <p> <span class="title">Cascading Style Sheets (CSS)</span> has been developed by the World Wide Web Consorium, the same organization that develops specifications for HTML. The first CSS standard, <span class="title">CSS1</span>, was released in 1996, and a second standard, <span class="title">CSS2</span>, was released in 1998. The latest standard, <span class="title">CSS3</span>, is still under development. CSS is designed to augment HTML, not replace it. It provides several tools not available with standard HTML. </p> </div> |
The result:
Cascading Style Sheets (CSS) has been developed by the World Wide Web Consortium, the same organization that develops specifications for HTML. The first CSS standard, CSS1, was released in 1996, and a second standard, CSS2, was released in 1998. The latest standard, CSS3, is still under development. CSS is designed to augment HTML, not replace it. It provides several tools not available with standard HTML.