Could someone please tell me why in this page, the background image of the error box does not show up?
Small problems like this drive me nuts :'(
Could someone please tell me why in this page, the background image of the error box does not show up?
Small problems like this drive me nuts :'(
you specify the color after the image, the browser will use the parameter that comes last in the list and apply.
What you have now:
Change to:Code:#body div#statusbox_failure { background-image: url("../images/icon_failure.png"); background-color: #FFFAF1; border: 1px solid #D2A960; }
Code:#body div#statusbox_failure { background: #FFFAF1 url("../images/icon_failure.png"); border: 1px solid #D2A960; }
Do you have trouble reaching your site?
Check here first: News and Announcements
Don't forget that x10hosting has an irc server as well. Come and join the fun
server: irc.x10hosting.com, main channel: #x10hosting
There's a lot helpful users there if need help building your site
That's only true if you set both using separate "background" properties:
If you use the "background-color" and "background-image" properties, or a single "background" property, the image will display in front of the color.Code:#body div#statusbox_failure { background: url("../images/icon_failure.png"); background: #FFFAF1; border: 1px solid #D2A960; }
The problem is you set "background-attachment" to "fixed", which fixes the image relative to the viewport (in other words, the BG won't scroll). Remove the "background-attachment" property and it shows up.
By the way, you use a selector of "#body div#statusbox_success, div#statusbox_failure" in style.css when you probably want "#body div#statusbox_success, #body div#statusbox_failure".
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
I would do it like this:
Cheers!Code:#body div#statusbox_failure { background:#FFFAF1 url(../images/icon_failure.png) no-repeat 5px; border:1px solid #D2A960; }
Last edited by subsilver; 07-11-2009 at 09:20 AM.
change toCode:#body div#statusbox_success, div#statusbox_failure { background-attachment:fixed; background-position:left center; background-repeat:no-repeat; color:#000000; font-family:Verdana,Geneva,sans-serif; font-size:13px; height:100%; line-height:normal; margin:10px 8px 13px; padding:20px 20px 20px 60px; vertical-align:middle; }
Code:#body div#statusbox_success, div#statusbox_failure { background-position:left center; background-repeat:no-repeat; color:#000000; font-family:Verdana,Geneva,sans-serif; font-size:13px; height:100%; line-height:normal; margin:10px 8px 13px; padding:20px 20px 20px 60px; vertical-align:middle; }
I don't know what that will mess up on your other pages, but it will fix the problem you are having now.
o, and if you do not have it already get FF and install FireBug. That's how I debugged your problem.
Thanks! I would not have figured that out myself
Does that mean with the background attachment set to fixed, the image was fixed at left: 0; top: 50%; relative to the window rather than the element?
Last edited by Twinkie; 07-11-2009 at 02:40 PM.
You could have if you created a minimal test case or used a CSS debugger, such as Firebug, Firefox's DOM inspector or Safari 4's debugger. It's easiest to selectively disable style rules in Safari 4.
Yes.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.