Which CSS property creates rectangles with rounded corners around text?

Prepare for the CIW Advanced HTML5 and CSS3 Specialist Exam. Study effectively with comprehensive materials, flashcards, and engaging multiple-choice questions. Enhance your expertise and get ready to succeed!

Multiple Choice

Which CSS property creates rectangles with rounded corners around text?

Explanation:
Border-radius controls the curvature of an element's corners. By assigning a radius value, you round the corners of the box that contains the text, so the text sits inside a rectangle with softened edges. For example, applying a value like 12px creates subtle rounding, while 50% can yield a pill or circle shape if the element’s height matches its width. Other properties don’t change the box shape: border draws a straight edge around the element, box-shadow only adds shading, and outline outlines the element without altering its corners. So the rounded corners come specifically from border-radius.

Border-radius controls the curvature of an element's corners. By assigning a radius value, you round the corners of the box that contains the text, so the text sits inside a rectangle with softened edges. For example, applying a value like 12px creates subtle rounding, while 50% can yield a pill or circle shape if the element’s height matches its width. Other properties don’t change the box shape: border draws a straight edge around the element, box-shadow only adds shading, and outline outlines the element without altering its corners. So the rounded corners come specifically from border-radius.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy