CS1115/CS5002

Web Development 1

Dr Derek Bridge

School of Computer Science & Information Technology

University College Cork

Horizontal centering I

Horizontal centering II

Centering in general

Getting help with your CSS

Navigation menus

Navigation menus: row of horizontal 'buttons'

Navigation menus: row of horizontal 'buttons'

nav ul {
    list-style: none;
    margin: 0;
    padding: 1em;
}

nav li {
    display: inline;
}

nav a {
    border: 0.0625em solid #711515;
    padding: 0.5em 1em 0.5em 1em;
    text-decoration: none;
    color: white;
    background-color: #B51032;
}

nav a:hover {
    background-color: #711515;
}

nav a[href=""] {
    color: black;
    background-color: white;
}

Navigation menus: vertical sidebar

Navigation menus: vertical sidebar

nav ul {
    list-style: none;
    margin: 0;
    padding: 1em;
}

nav li {
    display: inline;
}

nav a {
    border: 0.0625em solid #711515;
    padding: 0.5em 1em 0.5em 1em;
    text-decoration: none;
    color: white;
    background-color: #B51032;
    display: block;
}

nav a:hover {
    background-color: #711515;
}

nav a[href=""] {
    color: black;
    background-color: white;
}

Alternative