HTML and CSS Certification Practice Test

Question: 1 / 400

What CSS property controls the space between an element's border and its content?

margin

padding

The CSS property that controls the space between an element's border and its content is padding. Padding is specifically designed to create inner space within an element, effectively pushing the content away from the edges of the border. This property allows for precise control over how much space is added around the content inside an element, enhancing the overall layout and visual appearance.

In contrast, margin is used to create space outside of an element's border, affecting the distance between it and neighboring elements. Border-spacing relates to the spacing between borders of adjacent cells in a table layout, while spacing is not a recognized CSS property. Thus, padding is the correct choice as it directly modifies the internal space surrounding an element's content, ensuring clarity in design and improved readability.

Get further explanation with Examzify DeepDiveBeta

border-spacing

spacing

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy