This is the HTML for the navbar I was trying to create , header has been set to have a background color of white and lack for its text color but still won't take any effect when the code is being run.
body {
margin: 0;
padding: 0;
background-color: #999;
}
.head {
background-color: #fff;
}
.head #logo {
margin: 0;
padding: 0;
float: left;
}
.head .menu {
clear: none;
padding: 0;
float: right;
margin: 0;
list-style: none;
}
.head .menu a {
text-decoration: none;
color: black;
padding: 10px 0px 0px 5px;
}
.head .menu li {
float: left;
}
.head .menu a:hover {
background-color: #bbb;
}
<head>
<title>Page Title</title>
</head>
<body>
<header class="head">
<h1 id="logo">CORP</h1>
<ul class="menu">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</header>
</body>
For some reason, it doesn't display the header background color. What could I have done wrong?
?
– Solomon May 02 '20 at 10:49`. It depends on your needs. You can style the anchor tags to display them the same as well. – Harun Yilmaz May 02 '20 at 10:58