Inline Element Vs Block Level Element
Inline Element Vs Block Level Element
Level Element
</>
Topics Covered
Introduction to Inline element
Introduction to Block element
Inline vs Block level elements
The HTML(HyperText markup language) elements historically were categorised as either Block-level
elements or Inline-level elements.
Note - Basic Inline CSS is used for understanding Block and Inline elements. More about CSS will be
discussed later.
An inline element is an HTML element that is used to define a part of a document's content within another
block-level element, without creating a new line.
inline.html
In this example, we have three spans, and as we know span is an inline-level element so each span
appears just after the previous span on the same line.
A block-level element is a displayed element on a separate line, coming after the content that comes
before it.
Example:- <p> tag, <h1> tag, <div> tag, <section> tag , <ul> tag etc.
block.html
Browser output -
In this example, we have three divs, and as we know div is block level element so each div appears after
the previous div on the next line.
Here are some of the points to compare the difference between Inline and Block level elements -