+ 3
plz explain the use of span and div in easy words...
solve the problem
4 odpowiedzi
+ 9
Hello, Ahmad Mughal !
The main difference between these two tags - one of them <span> is a line item, and the other <div> is a block element.
This means that using the
<div> tag, you can select a piece of information (text, pictures, etc.) into a separate block and set certain style properties to it.
The <div> block always has indents: before <div> and after </div>. And with the help of the <span> tag, you can select a string, word or a single letter inside other tags, and then set a separate style for the selected text. And for <span> you can not set the width and height attributes, as well as for any other line item.
https://www.sololearn.com/learn/HTML/1034/
+ 4
Hii Ahmad !
Simply <div> is the block level element while <span> is the line level element.That means <div> can contain a no. of tags inside it to enhance their beauty by using color,height or width like attributes.
But <span> can contain only a string or a word or a letter and not the whole tag.Span is also used to enhance the buty but inside the text.
Hence <div> create a block while <span > is used inside a line.
+ 3
thanks sir...
+ 2
Thanks shivanshi i understand ur answer very well...