+ 2
Please mention A brief difference between span and div. Thanks in advance
I just want to clear concept about span amd div
4 ответов
+ 6
The difference between span and div is that a span element is in-line and usually used for a small chunk of HTML inside a line (such as inside a paragraph) whereas a div (division) element is block-line (which is basically equivalent to having a line-break before and after it) and used to group larger chunks of code.
Burey post best example of it kindly see it
+ 3
the way I always thought about it was...
div: a container element for one or more elements, like a group of buttons you want aligned on the right side of a nav menu
span: a bit of text you want styled differently, like "messages <span>7</span>, the span tags cud be styled to b a small circle with 7 in the center
+ 2
Simple way:
Span/ is part of block or an element that you want to apply some change to ( for example word or more from sentence will be choose and have change property and the remain sentence will stay without change).
Div/ is all words of that sentence will be change (complete block).