Results 1 to 6 of 6

Thread: CSS Error

  1. #1
    Join Date
    Jun 2005
    Location
    Canada
    Posts
    68
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default CSS Error

    So I am finally migrating from MS Front Page to real php and css websites with the help of W3C schools and this forum.
    I have just done up one site without FrontPage and admit that it is nowhere near as difficult as I thought (although I only did some basic stuff)
    Problem is I am getting a CSS notice through Firefox whether I run internally through the WAMP server or online. The following is the error:

    CSS ERROR; expected ":" but found 'size' Declaration Dropped

    Now I have gone through W3C and this forum to find out what this might be and have checked stylesheet.css and have drawn a blank in spite of the fact the stylesheet I am sure is extremely simple.

    If anyone has any suggestions they would be gratefully accepted. I have included the entire stylesheet below. There is nothing above or below what you see. Apart from the error above, everything seems to work fine on the live site.


    CSS:

    h1 {
    font-family: Tahoma; sans serif;
    font-size: 150%;
    color: #FF0000
    }

    h2 {font-family: Tahoma; sans serif;
    color: red;
    font-size: 110%;
    background-color: yellow
    }

    p {
    font-family: Tahoma; sans serif;
    font-size: 90%
    }

    span {
    color: #FFFF00
    }


    td {
    font-family: Tahoma; sans serif;
    font-size: 90%
    }

    th {
    font-family: Tahoma; sans serif;
    color: #FF0000;
    background-color: yellow;
    font size: 100%
    }

    Thanks for your help.
    D

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This:

    Code:
    th {
    font-family: Tahoma; sans serif;
    color: #FF0000;
    background-color: yellow;
    font size: 100%
    }
    should be:

    Code:
    th {
    font-family: Tahoma; sans serif;
    color: #FF0000;
    background-color: yellow;
    font-size: 100%;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Diversions (07-24-2008)

  4. #3
    Join Date
    Jun 2005
    Location
    Canada
    Posts
    68
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    Clearly I have to learn to be more attentive to the little details. One additional thing. After I made the corrections it was finding fault with the line:

    font-family: Tahoma; sans serif;

    when I deleted the "sans serif;" I now show no errors in CSS.
    Is there a problem if I just leave sans serif off or could I run into a problem with some visitors not seeing any text if they do not have Tahoma installed in their fonts?

    Thank you
    D

  5. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    The list should be separated by commas, not semicolons. So change it to:

    Code:
    font-family: Tahoma, sans serif;
    If you don't specify a font family, the browser will use whatever the default system font is. Same thing if the user doesn't have that particular font installed. So, you don't have to worry about your text not showing up. It's just a matter of what font is used.
    Last edited by Medyman; 07-24-2008 at 04:06 PM. Reason: typo

  6. The Following User Says Thank You to Medyman For This Useful Post:

    Diversions (07-24-2008)

  7. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's actually (with a dash):

    Code:
    font-family: Tahoma, sans-serif;
    And it is prudent, though not yet required (some day maybe) and won't hurt now, Tahoma could better be tahoma (lower case).

    And as a side note, if the family property really is more than one word, it should be quoted, ex:

    Code:
    font-family : 'times new roman', serif;
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Diversions (07-24-2008)

  9. #6
    Join Date
    Jun 2005
    Location
    Canada
    Posts
    68
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    Clearly I have much yet to learn but I really appreciate your guidance and now there does not seem to be any further CSS warnings.
    I do appear to have a problem with the img now but I will attempt to work through that myself. It adheres to a calcified brain easier when one has to work for it!

    Cheers all and as always, excellent advice.

    D

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
  •