OMIED BADR
asked on
CSS background-color
my background-color of my navbar will not change? my code is below.
!DOCTYPE html>
<html>
<head>
<title>Omied Badr|Web Developer</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header>
<h1><strong>Omied Badr | Web Developer</strong></h1>
</header>
<nav class="nav1">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</body>
<html>
body {
margin:0;
background-color: #e6e6e6;
}
header {
text-align: center;
}
nav {
background-color: black;
}
.nav1 {
list-style: none;
float: right;
margin-left:20px;
}
li {
display: inline;
margin-left:20px;
}
a {
position: relative;
left: -200px;
color: white;
text-decoration: none;
}
!DOCTYPE html>
<html>
<head>
<title>Omied Badr|Web Developer</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header>
<h1><strong>Omied Badr | Web Developer</strong></h1>
</header>
<nav class="nav1">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</body>
<html>
body {
margin:0;
background-color: #e6e6e6;
}
header {
text-align: center;
}
nav {
background-color: black;
}
.nav1 {
list-style: none;
float: right;
margin-left:20px;
}
li {
display: inline;
margin-left:20px;
}
a {
position: relative;
left: -200px;
color: white;
text-decoration: none;
}
The black background is there, it's floating to the right because the nav1 class is being applied to it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The background is black when I test your code. Have you refreshed your browser cache by pressing F5 ?
https://jsfiddle.net/zephyr_hex/fwyp8472/
https://jsfiddle.net/zephyr_hex/fwyp8472/
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you so much