HTML/CSS/JS - A Toggled Side-menu
22 Sep 2015
A key part of any web page front-end is navigation, enabling the user to go from one section to another easily and intuitively.
This week we will talk about coding a toggled side-menu which, incidentally, should work nicely on any device, including smartphones and tablets.
Through this exercise we will revise:
- general HTML document structure
- CSS and JavaScript integration
- CSS rules targeting HTML elements by
class
/id
- JavaScript event listeners and event handling
New things we will cover include:
- HTML
nav
, ul
and li
elements
a
(anchor) and h1
elements
viewport meta
tag
- CSS properties
position
, list-style-type
, text-decoration
line-height
, text-align
hover
pseudo-class and cursor
transition
- JavaScript
querySelector
function
if
statement
The goal is to produce something like this.
##Code
The complete code from this session is shown below. The same code has also been pushed to our Github repository.
###index.html
###public/css/style.css
###public/js/script.js
##References & Resources