Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Mariano Giustozzi
3,351 PointsCSS BACKGROUND COLOUR WONT CHANGE
When I run the code the background colour doesnt change although the Nav does-
<!DOCTYPE html> <html> <head> <title>TRANOHF SRL</title> <link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <h1 class="text-center">Transporte de Cargas Liquidas</h1> <div class="container"> <div id="nav1" class="navbar"> <ul class="nav navbar-nav"> <li> <a href="index.html"><i class="fa fa-home"></i> Inicio</a> </li> <li class="active"> <a href="galeria.html"><i class="fa fa-photo"></i> Galeria</a> </li> <li> <a href="contacto.html"><i class="fa fa-envelope"></i> Contacto</a> </li> <li> <a href="nosotros.html"><i class="fa fa-users"></i> Nosotros</a> </li> </ul> </div>
CSS:
body { background-color: Red;
}
nav1{
margin-left: 340px; font-size: 20px;
}
1 Answer
Dario Tordoni
9,635 PointsHi Mariano, I tried your code and it worked for me, both background and nav element are red. Are your body, div and html tags correctly closed? Because they aren't in the snippet
Furthermore, you are using an ID selector for the nav element so you should write #nav1