+ 1
Isn't <div> and <span> the same thing since they can be used for the same purpose?
5 ответов
+ 6
Div is a block level element
Span is an inline element
+ 5
You should go through this article.
https://www.differencebetween.com/difference-between-div-and-vs-span/
+ 5
Span should be used to decorate inline content, for example, if you want to decorate a word inside a paragraph, you write:
<p> this is a <span class="example">paragraph</span>· </p>
You then use CSS to decorate this word.
Div is used to decorate block elements, for example, if you wanted to decorate two paragraphs, you would write:
<div class="example">
<p> bluh bluh bluh </p>
<p> bluh bluh bluh </p>
</div>
+ 1
Thank you guys