Here is the html code snippet:
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>
The issue with not being able to see a background color or effect for the header
element and its child nav
element might be due to CSS properties conflicting or overriding each other. It's important to check the specificity of the styles applied and make sure there are no conflicting rules affecting the elements.