Results 1 to 6 of 6

Thread: CSS not working in Firefox [resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Resolved CSS not working in Firefox [resolved]

    I have the following code on my page, but the CSS formating that I have does not show up in Mozilla Firefox. What am I doing wrong?

    <head>
    <LINK REL=StyleSheet HREF="Style.css" TYPE="text/css" MEDIA=screen>
    </head>
    Last edited by mrstuff68; Dec 29th, 2005 at 12:21 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: CSS not working in Firefox

    Looks fine. Show us the CSS file and the rest of your HTML.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Re: CSS not working in Firefox

    It works fine in IE but doesnt in Firefox.

    Here is my html

    HTML Code:
    <head>
    	<LINK REL=StyleSheet HREF="Style.css" TYPE="text/css" MEDIA=screen>
    </head>
    <body>
    <table width="95%" align="center">
    	<Tr>
    		<Td>
    <div align="center"><font class="header">Fitness Calculators</font></div>
    <br><br>
    <a href="http://www.exrx.net/Calculators.html">www.exrx.net/Calculators.html </a> 
    		</TD>
    	</TR>
    </table>	
    </body>
    </html>
    And this is my CSS file

    [CSS]

    .header
    {
    COLOR: #ac2b31;
    FONT-FAMILY: Bauhaus 93;
    FONT-SIZE: 18pt;
    FONT-WEIGHT: normal;
    }

    .heading
    {
    COLOR: #00ABC7;
    FONT-FAMILY: Bauhaus 93;
    FONT-SIZE: 14pt;
    text-decoration: underline;
    }

    body
    {
    margin-top: 0px;
    margin-bottom: 0px;
    scrollbar-3d-light-color: #00ABC7;
    scrollbar-arrow-color: #ac2b31;
    scrollbar-base-color: #00ABC7;
    scrollbar-darkshadow-color: #00ABC7;
    scrollbar-face-color: #00ABC7;
    scrollbar-highlight-color: #ac2b31;
    scrollbar-shadow-color: #ac2b31;
    scrollbar-track-color: #00ABC7
    }
    [/CSS]

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: CSS not working in Firefox

    If you are using XHTML you must enclose all attributes with quotation marks and all tags/attributes must be in lowercase as XML is case sensitive. You should not use <font> tags and you should specify things like width's in your CSS.

    Although, none of that will cause the page to display incorrectly, it will simply be invalid XHTML, and if you are not using XHTML then it is perfectly OK. The unfortunate part is that CSS is also case sensitive

    HTML Code:
    <html>
        <head>
            <link rel="stylesheet" href="Style.css" type="text/css" media="screen">
        </head>
        
        <body>
            <table>
                <tr>
                    <td>
                        <div align="center">
                            <span class="header">Fitness Calculators</span>
                        </div>
                        <br /><br />
                        <a href="http://www.exrx.net/Calculators.html">www.exrx.net/Calculators.html</a>
                    </td>
                </tr>
            </table>
        </body>
    </html>
    CSS:
    Code:
    .header
    {
        color: #ac2b31;
        font-family: Bauhaus 93;
        font-size: 18pt;
        font-weight: normal;
    }
    
    .heading
    {
        color: #00ABC7;
        font-family: Bauhaus 93;
        font-size: 14pt;
        text-decoration: underline;
    }
    
    body
    {
        margin-top: 0px;
        margin-bottom: 0px;
        scrollbar-3d-light-color: #00ABC7;
        scrollbar-arrow-color: #ac2b31;
        scrollbar-base-color: #00ABC7;
        scrollbar-darkshadow-color: #00ABC7;
        scrollbar-face-color: #00ABC7;
        scrollbar-highlight-color: #ac2b31;
        scrollbar-shadow-color: #ac2b31;
        scrollbar-track-color: #00ABC7
    }
    
    body table
    {
        width: 95%;
    }

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: CSS not working in Firefox

    Open up the JavaScript console. See if there's a warning that says something like, "Style sheet declared as text/css, but actually is text/plain." If there is, you have a server misconfiguration.

    Edit: Although looking at your HTML, I very much doubt Mozilla is in standards mode, so it wouldn't ignore the style sheet ...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    492

    Re: CSS not working in Firefox

    Ok I figured it out myself.
    Apprently I cant use the following in CSS: font-family: Bauhaus 93;
    I put in the following line:FONT-FAMILY: "Bauhaus 93", Verdana, Helvetica, sans-serif;

    And it works like a charm.

Posting Permissions

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



Click Here to Expand Forum to Full Width