FireFox vs IE for CSS

Discussion in 'CSS' started by sanjayc, Jun 25, 2006.

  1. #1
    I have the following lines in my HTML

    heading {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 150%}
    url {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 90%}
    rating {font-family: Tahoma, serifSansSerifMonospace; font-size: 90%}
    formtitle {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 90%}
    description {font-family: Tahoma, serifSansSerifMonospace; font-size: 90%}
    small {font-family: Tahoma, serifSansSerifMonospace; font-size: 75%}
    pagenumbers {font-family: Tahoma, serifSansSerifMonospace; font-size: 75%}

    Now when I view pages with FireFox (my normal browser) everything looks fine, however when I load my page in IE none of the styles work. Anyone have any ideas what I'm doing wrong?

    Cheers
     
    sanjayc, Jun 25, 2006 IP
  2. YMC

    YMC Well-Known Member

    Messages:
    2,787
    Likes Received:
    404
    Best Answers:
    4
    Trophy Points:
    190
    #2
    Perhaps change: font-family: Tahoma, serifSansSerifMonospace;

    to: font-family: Tahoma, serif, sans-serif, monospace;
     
    YMC, Jun 25, 2006 IP
  3. sanjayc

    sanjayc Guest

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I tired it and no joy. Still not working in IE. Any more ideas anyone?
     
    sanjayc, Jun 25, 2006 IP
  4. YMC

    YMC Well-Known Member

    Messages:
    2,787
    Likes Received:
    404
    Best Answers:
    4
    Trophy Points:
    190
    #4
    What's not working about them? Or post a link.
     
    YMC, Jun 25, 2006 IP
  5. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Post a link. You haven't put a semi-colon after the font-size values. i.e. font-size: 150%;
     
    AdamSee, Jun 25, 2006 IP
  6. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #6
    If those are classes try added a dot before each one...
    i.e.

    .heading {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 150%}

    If they are ID's you need to add the #

    i.e.

    #heading {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 150%}
     
    RectangleMan, Jun 25, 2006 IP
  7. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    A semi-colon is not necessary there.

    sanjayc, your selectors are formatted as if they were tags, but there is no heading, url, rating, formtitle, description, or pagenumbers tags in HTML. It doesn't seem like any browser should apply these CSS rules.

    As the others have said, attach the page and CSS to a post here, or post a link to the problem page.
     
    FeelLikeANut, Jun 25, 2006 IP
  8. sanjayc

    sanjayc Guest

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks folks, here is the whole css section.

    <link rel="stylesheet" type="text/css" href="styles.css">
    <style type="text/css">
    <!--
    a:link {color: #000000} /* unvisited link */
    a:visited {color: #000000} /* visited link */
    a:hover {color: #000000} /* mouse over link */
    a:active {color: #000000} /* selected link */

    heading {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 150%}
    url {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 90%}
    rating {font-family: Tahoma, serifSansSerifMonospace; font-size: 90%}
    formtitle {font-family: Tahoma, serifSansSerifMonospace; font-weight: bold; font-size: 90%}
    description {font-family: Tahoma, serifSansSerifMonospace; font-size: 90%}
    small {font-family: Tahoma, serifSansSerifMonospace; font-size: 75%}
    pagenumbers {font-family: Tahoma, serifSansSerifMonospace; font-size: 75%}
    -->
    </style>

    The page is http://www.in4matrix.co.uk/search This page looks fine in firefox, all the css tags work but no luck in IE.

    Thanks for all your help much appreciated!!!
     
    sanjayc, Jun 25, 2006 IP
  9. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ultimately the problem lies with your HTML code. You are using tags that do not exist in HTML: HEADING, FORMTITLE, URL, RATING, and DESCRIPTION tags all appear in the page, but none of them are HTML tags.
     
    FeelLikeANut, Jun 25, 2006 IP
  10. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #10
    That Firefox allows the faux elements to be rendered is a holdover from its xhtml parser. XHTML allows you to make up your own elements, but to be correct, you must properly extend your DTD.

    You haven't properly extended the DTD, in fact, you haven't even published your DTD. Nor, are you using xhtml as xml, anyway.

    Correct your errors first. I suggest you study some html tutorials and learn how to mark up your content.

    cheers,

    gary
     
    kk5st, Jun 26, 2006 IP
  11. tposs

    tposs Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Two words: CSS Validator

    Oh, and don't make your visited links and unvisited links the same color. Visitors like to know where they've been.

    --Tony
    Webmaster, www.PaidOnlineSurveyCenter.com
     
    tposs, Jul 1, 2006 IP