Div and span elements in HTML

Valid values for id attribute

For special formatting,  div and span elements are used. You need to add styles in css for proper formatting or looks and feel. The difference between <div> and <span> is <div> is displayed as a block and <span> is displayed as inline text.

Example of div and span elements:

The <div>quick brown</div> fox jumps over the lazy dog.
The <span>quick brown</span> fox jumps over the lazy dog.

Leave a Reply

Your email address will not be published. Required fields are marked *