I'm trying to make a header menu that has horizontal list (a navigation area or menu) on the right and the h1 (name of the website) on the left (both using float tags to do so). I tried grouping the two together with header, nav, and div tag but nothing works. the h1 and ul tag act as if separate, not grouped. when i give the grouping tag (Div, header, nav) background color nothing happens, but when i give it a color: .... all the text inside does change color, so at least that works.
Please help me group h1 and ul together.
.header {
width: 100%;
background-color: aquamarine;
color: red;
}
h1 {
float: left;
}
ul {
float: right;
list-style: none;
display: block;
}
ul li {
display: inline-block;
}
<html>
<body>
<header class="header">
<h1>website name</h1>
<ul>
<li>Home</li>
<li>contact</li>
</ul>
</header>
</body>
</html>