1-5 Year Interview Que.Fresher Interview Que.HTML/HTML5

What is the difference between “div” and “span” elements?

In this article today we are talking difference between “Div” and “Span”

<div> Div is block element are take the full available width of block level. Div tags are used to define section in document block wise element.

Note: Block level elements are <div>, <p>, <img>, <section> and many more.

Example of block level element see below:

<div> full available width of block level </div>

<span> Span Inline elements are only take the width that is required to fit into the box.

span is very similar to the HTML “div” tag, but div is a block-level tag and span is an inline tag. Span element is a generic online container for online elements and content.

Span Inline elements are only take the width that is required to fit into the box.

Example of inline element see below:

<span> required to fit width into the box. </span>

difference between “div” and “span” elements

difference between "div" and "span" elements
difference between div and span
top html interview question

Top HTML / HTML5 Interview Questions

click on button to view and read HTML Interview Questions
%d bloggers like this: