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


What is <div> and <span>

7/25/2019 5:40:04 PM


6 Answers

New Answer


<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>


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>


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


Line break not line bread


Thanks all


div its a block