0
What is <div> and <span>
6 Respuestas
+ 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