0
0
CSSmarkup~20 mins

Text decoration in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Text Decoration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
1:30remaining
What is the output of this CSS snippet?
Given the CSS below, what will be the style of the text inside the <p> element?

p { text-decoration: underline overline; }
CSS
<p>This is a test text.</p>
AThe text will have no decoration.
BThe text will have only an underline.
CThe text will have only an overline.
DThe text will have both an underline and an overline.
Attempts:
2 left
💡 Hint
Think about how multiple values for text-decoration work.
🧠 Conceptual
intermediate
1:00remaining
Which CSS property controls the color of the text decoration?
You want to change the color of an underline on a link. Which CSS property should you use?
Atext-decoration-color
Bcolor
Ctext-color
Ddecoration-color
Attempts:
2 left
💡 Hint
The property name includes 'text-decoration' and relates to color.
rendering
advanced
1:30remaining
What will be the visual result of this CSS on a paragraph?
Consider this CSS:
p { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: red; }

What will the underline look like?
CSS
<p>Sample text</p>
AA straight red underline below the text.
BA wavy red underline below the text.
CNo underline will appear.
DA dotted red underline below the text.
Attempts:
2 left
💡 Hint
Look at the 'text-decoration-style' value.
selector
advanced
1:30remaining
Which selector applies underline only to links inside a nav element?
You want to underline only <a> elements inside a <nav> element. Which CSS selector is correct?
Anav a { text-decoration: underline; }
Ba nav { text-decoration: underline; }
Cnav > a { text-decoration: underline; }
Da > nav { text-decoration: underline; }
Attempts:
2 left
💡 Hint
Think about the order and relationship of elements in selectors.
accessibility
expert
2:00remaining
Why should you avoid using only 'text-decoration: none' on links for accessibility?
Removing underlines from links with 'text-decoration: none' can cause what accessibility issue?
AIt changes the font size unexpectedly.
BIt causes links to become unclickable.
CUsers may not recognize links because underlines help identify them.
DIt disables keyboard navigation.
Attempts:
2 left
💡 Hint
Think about how people visually identify links.