Growing Underline Menu
HTML / CSS
20 pts
Growing Underline Menu
Give every link in .nav a brown line that grows on hover.
- Add
position: relativeto.nav a. - Write a
.nav a::afterrule:content: "",position: absolute,left: 0,bottom: -4px,width: 0,height: 2px, background#b45309andtransition: width 0.3s ease. - Write a
.nav a:hover::afterrule withwidth: 100%.
Checklist
- Make each link a positioning parent.
- Create the line with
::after, starting at width 0. - Transition the width and grow it to 100% on hover.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
