GitLab interview question

Difference between inline, inline-block, and block elements?

Interview Answer

Anonymous

7 Nov 2016

Inline: Inline elements does not begin on a new line and takes up as mich space as required. Inline-block: Inline-Block elements does not begin on a new line, but also has block level characteristics this means that we can manually set the width and height of the element and have them appear next to each other. Inline Elements: Block: Block level elements begins on a new line and takes up the full width available, i.e. if you do not set the height and width of a block level element it will take up the whole width of the page. Block Level Elements: <div> -h6> <p></p></div>

1