What is <div> and <span> | Sololearn: Learn to code for FREE!

0

What is <div> and <span>

7/25/2019 5:40:04 PM

ADVIPER

6 Answers

New Answer

+5

<span> inline element (affect single line) ๐Ÿ‘‡Lines( Example ) 1. 2. <span> hello </span> 3. ______________________________ <div> Block element (affect multiple lines) Example: 1. <div> 2. Hello 3. I love 4. Sololearn 5. </div> note: you can use <span> inside <div> ,but you can't use <div> inside <span>

+4

Div is an block element. You can use it to slice your html code into smaller pieces, and stylish them. span is an inline element and you can use it to stylish something inside an element (like a paragraph) <p>Hello<span style=color:red;> there</span></p>

0

<div> automatically adds a line bread in but <span> does not

0

Line break not line bread

0

Thanks all

-1

div its a block