Inline and Block Elements

Block Elements

Block elements always appear on a line line. Examples of these are the <h1> and <p> tags.

Inline Elements

Inline elements sit within a block level element and do not start on a new line. Examples of inline elements include the <strong><em>, and <img> tags. They always appear to continue on the sam line as their neighboring elements.

Changing an Inline Element to a Block Element

Sometimes, you need inline elements to behave like block elements. In order to do this, you use the style property display :

img { display:block;}

 

 

Leave a Reply

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