Class Exercise - CSS Selectors (1)
Class Exercise - CSS Selectors (1)
Intro to WebTech
You are given the HTML for a luxury car comparison website (provided by your
lecturer). Your task is to style it using CSS selectors.
Instructions
1. Set Up Your Files
Add this to styles.css to style the navbar (already done for you):
background-color: #2c3e50;
padding: 1rem 0;
font-family: Arial, sans-serif;
.nav-list {
list-style: none;
display: flex;
justify-content: center;
gap: 2rem;
margin: 0;
padding: 0;
.nav-item a {
color: white;
text-decoration: none;
font-weight: bold;
font-size: 1.1rem;
border-radius: 4px;
.nav-item a:hover {
background-color: #34495e;
o Background: #f9f9f9
o Padding: 1.5rem
o Width: 300px
o Background: #f0f0f0
o Padding: 1rem
o Italic text
5. Style the rating stars (rating class):
o Color: gold