SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Minneapolis, MN
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS -- works in IE not in FireFox, i'm a newb

    Ok, I have NO idea why this is happeneng. When I open my site in IE, it works great. In FireFox, it blows.

    Basically it looks like the stylesheet isn't being read. I don't understand why.

    www.54thavenue.com/index.htm and www.54thavenue.com/style.css

    The links don't show up correctly (not supposed to be blue and purple), and the text is the wrong font and size. WTF did I do wrong?

    I don't get it... HELP!

    and.... thank you!

    CWL

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I think its because your html tags are in upper case (should be lower case and using quotes) and the css is lower case (as it should be).
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that's not it. Firefox is picky, but not *that* picky, especially in quirks mode.

    There's something really peculiar going on here, and it's making my head hurt.

  4. #4
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I'm not sure I believe this myself, but here goes:

    For some reason, your web server (Apache) is serving the HTML file with a character encoding of "UTF-16 (Little-endian)" Quite why it should want to do that is utterly beyond me, and I think it's giving firefox a major-league headache. This is not a newb problem

    This might be relevant: how did you edit the html file, and how did you get it onto the web server?

    Completely unrelated: there's a couple of minor glitches in your CSS:
    Code:
    body {background color: white;
      ...
    That should be "background-color: white" (note the hyphen)
    Code:
    font-family: verdana, tahoma, trebuchet ms;
    Font names with spaces in them should be quoted:
    Code:
    font-family: verdana, tahoma, "trebuchet ms";
    I'm absolutely certain that this is not the cause of your main problems.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,797
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    I thinks its because you haven't told the browsers what you are loading.
    <LINK REL="Stylesheet" HREF="style.css">
    It should be:
    Code:
    <link rel="stylesheet" type="text/css" href="style.css">
    Paul
    Edit:


    Hmmm on second thoughts I don't think its that as i linked to your stylesheet in the same way and it worked in my browser.

    I notice you have an error on the very first line of your code.
    Code:
    body {background color: white;}
    You've missed the dash out:
    Code:
    body {background-color: white;}
    Bit I don't think its that either as it worked when I linked to your page.

  6. #6
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Minneapolis, MN
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    holy cow, thanks guys! i'll check it out and let you know what's going on... what worked, didn't, etc.

  7. #7
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul: I'm pretty sure it's the character encoding:
    Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=230785

    Basically, if the web server sends the page and the style sheet with different character-encodings, and doesn't include character-encoding HTTP headers on both, Moz gets confused (presumably it's assuming that the CSS has the same encoding as the page, unless told otherwise).

    I'm not surprised, and I don't really blame moz (much) - that's a really EEEEEVIL thing to do to a browser. IE probably only copes due to its longstanding habit of sniffing the content of incoming files and treating them like what they appear to be, rather than what the webserver said they were. Either that or it just assumes ISO-whatever unless told otherwise.

    clechner: I can't see any reason you'd want to do this (you don't have any non-english-language content lurking in the site do you? In fact, to need UTF-16, it would probably have to be non-roman-alphabet, even) If not, I reckon your webserver is mis-configured. Have words with the webserver admin.

    [Aha! it's fixed. No more evil UTF-16 (LE) content encoding headers, and it all works]

  8. #8
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Minneapolis, MN
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know what the rules on this board are for language, but i'm pretty sure i'm going to be violating it in the next line.

    **** CUTEFTP.... and if that gets blocked, PHOOK CUTEFTP...

    ok, very sorry about that. CuteFTP was doing "something" when it was uploading the files.

    bascially, i took those pages, did a view source, then copied it to Notepad again, saved the pages, and then uploaded the "new" version with WS_FTP... miraculously it worked.

    the strange thing is, i admin'd a different website with Cute for quite a while, same version of Cute, on the same box, same install. surely it was a setting within Cute (that i searched and search for and couldn't find). wtf....

    anyway, that's the answer and it's very very strange. thanks for your help guys.... when blufive asked when/how i upload/change content i thought it might be something strange like that. strangely, when i loaded the webpages in cute's web-editor (which i don't use, but it offers a notepad view) it didn't come up right, but it did everywhere else. i knew at that point it might be something with Cute.

    thanks again... now was that weird or what?

  9. #9
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Minneapolis, MN
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and BlueFive, holy crap, there's no way you should be able to find that minute of a detail.... HATS OFF!!!!!!!!!!!!!!! very cool..... thanks for the help again... you have no idea how insanely crazy i was (or maybe you do.......)...

    CWL

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,797
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by gav
    Paul: I'm pretty sure it's the character encoding
    Good find Gav (I was looking in the right sort of area then lol)

  11. #11
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe. No problem. That was a doozy though.

    Having taken the CSS apart line-by-line, I realized that Firefox was just ignoring the stylesheet altogether. At which point, long experience told me to start looking at the HTTP headers. And then the UTF-16 character encoding leapt out at me, cos that's REALLY odd for an english-language page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •