10 Questions
What is the primary difference between block and inline elements in HTML?
Block elements take up full width and start on a new line, while inline elements occupy only necessary width.
What is the general rule for nesting block and inline elements?
Most block elements can contain inline elements and other block elements.
Why is it invalid to place a <div>
inside a <span>
?
Because <div>
is a block element and <span>
is an inline element.