what is the difference between inline-block and block?

Report
Question
767 views

Inline-Block vs Block

Please explain why do you think this question should be reported?

Report Cancel

 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

Leave an comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>