Jump to content

background image not showing


setmoa
 Share

Recommended Posts

Hi I am a complete novice but trying to learn CSS and build a website. I have a banner towards the top of my page in which I want a background image, I think I have it correctly but the image is not showing: CSS: #banner { background-color:#F00; width:100%; height:244px; float:left; background-image:url(../images/banner.png)0 0 repeat-x; } the width of my wrapper DIV is 1170 HTML for the DIV: <div id="banner"><p>HOME IT MEDIC</p></div> the background color is really just there so that I could see the div. Do you need any further info to help? Thanks in advance - i have also attached the full files. Ally

main.css

index.html

Link to comment
Share on other sites

You have confused the 'background' property with the 'background-image' property. 'background' can be assigned multiple values, including the image URL, repeat, coordinates, and so on. 'background-image' can only be assigned the value of a URL. Try removing '0 0 repeat-x' from your rule.

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...