Having this html:
body {
font-family: Arial, Helvetica, sans-serif;
}
header {
background-color: rgb(93, 43, 78);
background-image: -webkit-linear-gradient(right, rgb(93, 43, 78), rgb(8, 2, 50)); /* no color in background */
}
header nav {
background-color: red; /* neither here, still white background */
}
header ul {
list-style: none;
}
header li {
float: left;
color: black;
}
p {
clear: both;
}
<html>
<body>
<header>
<nav>
<ul>
<li>test item1</li>
<li>test item2</li>
</ul>
</nav>
</header>
<section>
<br />
<p>some text</p>
</section>
</body>
</html>
I am not able to see background nither for the header
parent element, nor for the nav
child element (of the header
). Both are trying to make a background with some color or effect, but neither of them succeed. Why?