setmoa Posted April 5, 2013 Share Posted April 5, 2013 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 More sharing options...
jeffman Posted April 5, 2013 Share Posted April 5, 2013 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 More sharing options...
setmoa Posted April 5, 2013 Author Share Posted April 5, 2013 Well Deirdre's Dad you have made my day!!! thanks that worked a treat, and i've learnt something. Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now