Challenge - 5 Problems
Padding Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the computed padding for this CSS?
Given the CSS below, what is the total padding applied to the element on the left and right sides combined?
div { padding: 10px 20px 30px 40px; }CSS
div { padding: 10px 20px 30px 40px; }Attempts:
2 left
💡 Hint
Remember the order of padding values: top, right, bottom, left.
✗ Incorrect
The padding shorthand sets padding in the order: top, right, bottom, left. So right is 20px and left is 40px. Total left + right = 60px.
🧠 Conceptual
intermediate1:30remaining
Which padding property sets only the bottom padding?
You want to add space only below an element. Which CSS property should you use?
Attempts:
2 left
💡 Hint
Think about the side of the box you want to add space to.
✗ Incorrect
The 'padding-bottom' property adds space only below the content inside the element.
❓ layout
advanced2:30remaining
What is the visible width of the box with this CSS?
Consider this CSS and HTML:
What is the total visible width of the div in pixels?
div { width: 200px; padding: 10px 15px; border: 5px solid black; box-sizing: content-box; }What is the total visible width of the div in pixels?
CSS
div { width: 200px; padding: 10px 15px; border: 5px solid black; box-sizing: content-box; }Attempts:
2 left
💡 Hint
Remember that with content-box, padding and border add to the width.
✗ Incorrect
Width is 200px (content). Padding left+right = 15px + 15px = 30px. Border left+right = 5px + 5px = 10px. Total width = 200 + 30 + 10 = 240px.
❓ accessibility
advanced1:30remaining
Why is padding important for clickable buttons?
Which reason best explains why adding padding to buttons improves accessibility?
Attempts:
2 left
💡 Hint
Think about how users interact with buttons on different devices.
✗ Incorrect
Padding adds space inside the button, making the clickable area larger and easier to activate, especially on touch devices.
❓ selector
expert2:00remaining
Which CSS selector applies padding only to paragraphs inside a section with class 'intro'?
You want to add 20px padding only to
<p> elements inside <section class="intro">. Which selector is correct?Attempts:
2 left
💡 Hint
Think about the order: parent then child in selectors.
✗ Incorrect
The selector 'section.intro p' targets all
inside any