what is the difference between inline-block and block?
ReportQuestion
3 years ago 767 views
Inline-Block vs Block
The major difference is that display: inline-block
does not add a line-break after the element, so the element can sit next to other elements but display: block
starts on a new line and takes up the full width available. So that means block elements will occupy the entire width of its parent element.
example:-
<span style="color:red; display: inline-block;">span text</span>
<span style="color:red; display: block;">span text</span>
Thread Reply