Wednesday, 21 August 2013

How to add background image using CSS?

How to add background image using CSS?

i am will create a web page and I want to add background image using CSS.
But when i was add background image it's not work. I need your help
It's my file directory at folder name Source
css file
Source/assets/css/style.css
my image on
Source/assets/img/header.png
and this my html address
Source/index.html
HTML
<div id="container">
<div class="mainheader">
<nav class="menu">
<ul>
<li></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div><!-- mainheader-->
</div><!-- container -->
CSS
.mainheader {
margin: 0 auto;
background:url(assets/img/header.png);

No comments:

Post a Comment