here is my html for some reason the header tag isnt accepting the background color for black..
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="keywords" content=""/>
<meta name="description" content="" />
<style type="text/css">
header {
background:black;
}
nav ul li {
float:left;
margin-left:20px;
display:block;
}
nav ul li {
text-transform:capitalize;
padding:5px 0px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="index.php">today's deals</a></li>
<li><a href="recent.php">recent deals</a></li>
</ul>
<div class="clear"></div>
</nav>
</header>
</body>
</html>
To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.
Go to the Design tab. Click Customize to expand the set of choices for customizing your theme. Click Header Image to choose an image to be the background of the header. Click Header background to choose a color for the header section.
The attribute that is used to set background color of an HTML element is bg color. Depending on the element whose background color is to be set, we use the appropriate tag. The bgcolor attribute can be used with the following tags- body, table, td, th, tr, marquee.
To set the background color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <body> tag, with the CSS property background-color.
I've got it! I know it's been a while, but I was having the same problem. You must remember to apply width and height attributes to the header or it will not work.
header {
background-color: black;
display: block;
width: 960px;
height: 300px;
}
I had the same problem, because the background only covered paragraph or other tags, not the whole area.
have you tried
background-color:black;
well it could be it's not supported still
this worked for me
header {
background-color:black;
display:block;
overflow:hidden;
}
for thoose browsers that do support it i guess why nothing wasn't displayed at first glance it's because the default behaviour isn't using it as a regular element rather then making the page more seo friendly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With