HTML & CSS · Junior · Question 5 of 75
You set width: 200px; height: 50px on a <span> with no other styles. What happens?
- ✓Correct answer: Width and height are ignored because
<span>is an inline element - 2The element becomes exactly 200×50 pixels, like any block
- 3Only the width applies; the browser ignores the height
Explanation
width and height don't apply to inline elements - their size is determined by content. Vertical margin doesn't push neighbors either. To size the element, it needs display: inline-block, block, or must be a flex/grid item.