Jump to content

#header background-image, not working


Naomi
 Share

Recommended Posts

Hi all,

 

I just finished a webdesign course for home study.

Now I am working on my first assigment but it's going quite the way I want...

I want to use a background image in my header div.

Here is my code, what am I doing wrong? Can anybody help me please? Thank you!

 

my CSS:

 

#header {
background-image: url(header.jpg);
background-size: cover;
background-position: fixed;
text-align: center;
width: 100%;
height: 200px;
top: 100px;
}
HTML
<div id="header">
<header>
<div class="nav">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Classes</a></li>
<li><a href="">Contact</a></li>
</ul>
</div>
</header>
</div>
Edited by Naomi
Link to comment
Share on other sites

The first thing you need to do is make sure the image can actually be found by the CSS parser. The url you are using might need a path depending on the location of the image file in relationship to the location of the page file, and the css file.

Link to comment
Share on other sites

  • 2 weeks later...

Thank you for your reply, I was busy with exams so I didn't find the time to look at your reaction.

I checked the path so many times and tried everything and everytime thinking why it's not working now I look again and I see I did it wrong...

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...