Style sheet not recognized by some browsers
I've put together a simple 3 page site for a friend so he can practice and learn html and css. It's really just a mismatch of old content so he can see what divs, paragraphs, lists, floats, etc are and how to edit them. It used 1 external style sheet with a dozen or so styles that he can edit and play with. He's using Chrome to view and NotePad++ to do the edits.
When I created the pages I tested in IE, FF, Safari, and Chrome on my machine and everything displays as expected. After doing a few edits on his machine, testing in Chrome, things display as expected. However, when he uploaded the site to his server, only IE would use the style sheet.
I don't understand why that should happen! So I uploaded the site to my server and all 4 browsers display using the style sheet.
Any idea what the difference in servers could be? Are style sheets handled differently by some servers than other?
Eye for Video
If I had to guess, I'd guess that it has something to do with your style sheet href address having spaces in it. You could try renaming the folders without using spaces in the name (use underscores _ ) and then adjusting the href value of the style sheet link.
I checked with firebug, though, and it appears that his server is serving the .css file as text/html while yours is serving it as text/css.
It's a server issue, obviously.
If he's allowed to use a .htaccess file (I doubt it if his server is screwed up that badly to serve css and html) then you could try adding this to the .htaccess file:
AddType text/css .css
On his server, the doctype for this page is HTML Loose, with a bunch of stray "/>" terminating elements, and on your server the doctype is XHTML. I have no idea whether or why that might be the problem, but it is curious...
The file name uses underscores
But thanks for taking a look!
How can you tell that?
it appears that his server is serving the .css file as text/html while yours is serving it as text/css.
The use of the server is a freebee given to customers by the cable company so I'm not sure about the using .htaccess. But if it's an issue for him it would also be for other customers, maybe we can get them to change it.
Thanks for your comments.
As for the two diff DOCTYPES... I grabbed the header from one site (XHTML) and then after piecing it together for him decided to lossen it up for him while he was practicing...but I'll go back and change that just to test. Thanks!
Last edited by Eye for Video; 02-24-2010 at 10:35 AM.
Reason: added another response
Well, the first giveaway is the display the document when you load it up in chrome (the css sheet, I mean, not the HTML page). The one from your server is formatted and the one from his server is like something you'd see in notepad.
So then I loaded up the both urls with firebug and, under the Net tab, click All and you'll see a request for the stylesheet. Click that request and you can see the headers that are sent with the document.
Furthermore, Firebug has the requests divided up for you into All, HTML, CSS, JS, XHR, etc. When I load the file up on your server, the request shows up under CSS, when I load the file up on his server, it shows up under HTML.
There you have it, all my deductions. That's definitely your problem. If you uploaded the identical files to your server as he did to his, then it's a server issue and the .htaccess fix I suggested MAY work. Otherwise, contact tech support for that server, if you can and tell them the problem.
It has nothing to do with the HTML code because when the stylesheet is accessed directly its being served with the wrong content-type.
Last edited by aj_nsc; 02-24-2010 at 10:36 AM.
You're right, my bad. Usually you can see the underscores separate from the underlining, but I couldn't see it until I highlighted it...
Originally Posted by Eye for Video
Looks like Index is XHTML but About Us and Links is HTML loose.
They do not see the styles either... DANG!
Thanks all for the very promt responses and your interest!
We've got some things to work with now.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)