Inline Elements In HTML | And Examples

  • Post category:HTML
  • Post author:
  • Post last modified:June 14, 2021
  • Reading time:3 mins read
You are currently viewing Inline Elements In HTML | And Examples

HTML Inline Elements

an HTML elements comes with two types of display value by default.

Inline Element

In HTML, inline elements do not start from a new line or do not add a line break before and after where it is placed. It does not capture any extra spaces, it just takes as much width is necessary.

Inline Element – List

<a><img><select>
<abbr><input><small>
<b><kbd><span>
<bdo><label><strong>
<big><map><sub>
<br><object><sup>
<button><output><textarea>
<cite><q><time>
<code><samp><tt>
<i><script><var>
Inline Elements

Inline Elements – Example

<p> tag is a block level element and <span> tag is an inline element.

<p>Lorem ipsum <span>dolor</span> sit amet</p>

Result

Lorem ipsum dolor sit amet

<p> tag is a block element and the <a> tag is an inline element.

<p>Lorem ipsum <a href="#">dolor</a>sit amet</p>

Result

Lorem ipsum dolor sit amet

You can make an inline element into a block element by changing its display property value in CSS

Ashim Khatua

Professionally Web Developer since 2015, And also a Blogger. I am the founder of SiteCodings.com. I love to share my knowledge, which I earned the past few years. I want to share my knowledge with you through my Blog. Keep Reading.

Leave a Reply