+ 4
What is the diffrence beetween div and span.
3 Respostas
+ 3
main difference is span is inline and div is block level..that means div can contains many inline and block level elements..but span cannot contain block level elements. that means span scope is limited and the elements which can go inside span is limited..
0
div is a block level element which will take up the available full space (so it always starts with a new line)..and it can contain other block n inline elements , whereas inline elements occupies only the needed space and it may contain other inline elements.
and one more thing is that inline element's box height can't be increased with css by using properties like padding-top, height, etc.