CiTi · Computer Coding · Year One · Unit 3
Student Handout
In your own words, what does each part do?
The wrapper:<div class="dropdown">
The button: <button class="dropbtn">
The content: <div class="dropdown-content">
Explain this rule, reading right to left: .dropdown:hover .dropdown-content { display: block; }
Checklist before you move on: CSS is in css/style.css (not a <style> block) · Font Awesome <link> is in every page’s head · nav is pasted into every page · no href="#" left.
Make one change at a time. Predict first, test, then undo it before the next one.
overflow:hidden from .navbarposition:relative; to .dropdown.navbar a rule to the bottom of the stylesheet.dropdown:hover .dropbtn to .dropbtn:hoverRight-click your page and choose Inspect. In the top-left corner of the Inspect panel, click the mobile device icon (a small phone and tablet). Pick a phone from the Dimensions menu at the top of the page, then try your menu.
What went wrong at phone size?Now add this to the bottom of css/style.css, upload, and re-test:
Check each one when you feel confident you can do it.