Explain the difference between inline elements and block-level elements, in terms of how a browser displays them.
A block-level element is an HTML element that begins a new line on a web page and extends the full width of the available horizontal space of its parent element. It creates large blocks of content like paragraphs or page divisions.
eg:
<div style="border: 1px solid black">Hello
World</div>
An inline element does not start on a new line and only takes up as much width as necessary.
eg:
<p>This is an inline span <span style="border: 1px solid black">Hello World</span> element inside a paragraph.</p>
/* PLEASE UPVOTE */
Get Answers For Free
Most questions answered within 1 hours.