+ 4

What is the diffrence beetween div and span.

16th May 2018, 1:33 PM
Tarun Sharma
Tarun Sharma - avatar
3 ответов
16th May 2018, 3:12 PM
Jaydeep Khatri
Jaydeep Khatri - avatar
+ 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..
16th May 2018, 1:39 PM
Sunil Thakali
Sunil Thakali - avatar
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.
16th May 2018, 8:10 PM
SR Praveen Kumar
SR Praveen Kumar - avatar