I have a background image assigned to the body element. It’s 1px in width and I let it repeat horizontally. In IE, Firefox and Opera it looks fine, but when I look at my page in Safari or Chrome, the background doesn’t show up.
Why doesn’t the background show up in Safari and Chrome? And how can I make it show up?
body
{
font-family:verdana, sans-serif;
padding:0;
margin:0;
text-align:center;
background:#fff url(../img/background.gif) repeat-x center top;
}
I got it to work It seems to only work in Chrome and Safari when I use internal CSS within the Head tag. An external CSS won’t work, even when I use a simple code that Ryan is using.
I had @charset “utf-8”; between my code and my copyright text. I moved @charset “utf-8”; to the top of my stylesheet and that fixed the problem
I never knew @charset could have such an impact
Since I already have <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /> in my Head tag, could I remove @charset “utf-8”; from my stylesheets?
Yes you could remove it although the w3c recommend that you always include it.
From my understanding the http headers over-rule all other methods of encoding (but you would of course need to specify something in the page for viewing off-line or from cd etc).
What bug are you referring to Ryan? I don’t get a problem at all with Safari.
If you are referring to this bug then it is only evident when you do something invalid
The charset must be the very first thing in the stylesheet and then it will work properly. It is not allowed to be after any characters (visible or invisible) or comments or code.
If it’s badly formed or incorrectly placed then it will produce errors.
If you are referring to this bug then it is only evident when you do something invalid
The charset must be the very first thing in the stylesheet and then it will work properly. It is not allowed to be after any characters (visible or invisible) or comments or code.
If it’s badly formed or incorrectly placed then it will produce errors.
Yes, I siad in the thread I linked to that the charset was invalid, I pointed that out to the OP, however I did not know about how to go about best fixing the bug in the other thread, so I gave the OP in this thread and hte last thread the same advice.
I figured it had to be a bug though I did not go looking for the actual bug report.