SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    My stylesheet won't work in Firefox - help please

    Please could someone take pity on a near beginner.

    I've created a fairly simple site using HTML and CSS, sucessfully uploaded it and validated all the pages and the CSS.
    When opened in IE, everything seems to work perfectly, but when opened in Firefox all the styling has vanished.

    Anyone got any clue where I might have gone wrong, please.

    Very happy to supply more info if you say what you need.

    Thank you

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,510
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    How about some code

  3. #3
    SitePoint Member
    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I'm new here, so apologies if I'm being thick - I hope this is the right bit of code.

    The link from the pages to the stylesheet is
    <link href="style1.css" rel="stylesheet" type="text/css"/>

    Is there any other bit I need to post on here?

    FWIW, I did get an earlier version working in Firefox just on my computer. That stylesheet had a bit of coding for img elements which the final version didn't - I commented it out just to see if that made the difference, at which stage it stopped working, but when I removed the commenting markings it didn't go back to working.
    Last edited by Ruth56; May 26, 2009 at 09:13. Reason: Adding stuff

  4. #4
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Hi Ruth, welcome to Sitepoint!

    It's hard to know what's going on unless you post either your stylesheet or a link to your page. You can't post links yet, but you can write them out: www dot fubar dot com slash mysite dot html

    Here's the link I use in the site I'm working on:

    Code:
    <link rel="stylesheet" href="newstyle.css" type="text/css" media="screen">
    Yours is

    Code:
    <link href="style1.css" rel="stylesheet" type="text/css"/>
    I'm writing my code in HTML 4.01 and I'm assuming you're writing in XHTML. You might try a simple fix -- adding a space before that ending slash:

    Code:
    <link href="style1.css" rel="stylesheet" type="text/css" />
    I don't write in XHTML so I can't tell you if that makes a difference, but it's something to try. Otherwise, your parameters are in a different order than mine (no problem AFAIK), but they seem okay. (The media="screen" bit shouldn't make your site break by not being there.) Anything beyond this, you're going to have to provide us something to look at.

  5. #5
    SitePoint Member
    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.


    A bit of further investigation yesterday suggests that although I wrote using UTF-8, its showing up in Firefox as UTF-16 Little Endian. I've never heard of this, and have no idea if somehow that's the problem, but when I tried to force it back to UTF-8 I got gibberish.

    Edit: that turned out to be the problem. I've no idea how it happened, but I resaved the files, pushing them back to UTF-8, the reuploaded them, and that has solved the problem.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Black Max View Post
    I'm writing my code in HTML 4.01 and I'm assuming you're writing in XHTML. You might try a simple fix -- adding a space before that ending slash:

    Code:
    <link href="style1.css" rel="stylesheet" type="text/css" />
    I don't write in XHTML so I can't tell you if that makes a difference
    For anyone who is wondering that space is only required in HTML and not in XHTML and the space is there so that the / which is invalid doesn't make the prior attribute invalid as well. With XHTML the / is valid and so a space before it is unnecessary.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Felgall, thanks for clearing that up for me.

    Tommy, what the h*ll is UTF-16 Little Endian? Off to Google I go....

    Follow-up: First link was this: http://en.wikipedia.org/wiki/UTF-16 I'm as lost after reading it as I was before.


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
  •