Link to home
Start Free TrialLog in
Avatar of OMIED BADR
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;
      
      
}
Avatar of Nancy Rindone
Nancy Rindone
Flag of United States of America image

The black background is there, it's floating to the right because the nav1 class is being applied to it.
ASKER CERTIFIED SOLUTION
Avatar of Andrew Leniart
Andrew Leniart
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The background is black when I test your code.  Have you refreshed your browser cache by pressing F5 ?

https://jsfiddle.net/zephyr_hex/fwyp8472/
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OMIED BADR
OMIED BADR

ASKER

thank you so much