SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: css problems

  1. #1
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm trying to implement css into my website and am having some problems. I went to: http://www.westciv.com/style_master/...ial/index.html
    and read through the tutorial and tried to make a css file that would handle my page design. Here is the call I'm using, and I did have it placed bewteen the HEAD tags:
    <LINK REL="STYLESHEET" HREF="core-style.css" TYPE="text/css">

    And here is the coding I have in core-style.css:

    BODY {
    background-color: #F5F5F5;
    background-image: url(/images/newbg2.gif);
    font-family: Verdana, Helvetica, Tahoma, sans-serif;
    font-size: -1;
    text-color: #2F4F4F;
    }
    A:link {color: #393EFB}
    A:visited {color: #CC0000}
    A:active {color: #FF1493}

    When I try to go to the page none of the graphics or colors work. I've tried NS 4.73 and IE 5. Both the page calling the css file and the css file are in the same directory. What am I doing wrong? Thanks for your help.
    --Bill


    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    WA
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using -1 as a font size isn't valid in CSS. You have to use a unit (px, pt, em, etc.) a percentage, or a relative value (small, smaller, etc.).

    Also, text-color isn't valid either, just color, e.g. color: #2f4f4f.

    So, the whole style declaration should look more like this:

    BODY { background-color: #F5F5F5;
    background-image: url(/images/newbg2.gif);
    font-family: Verdana, Helvetica, Tahoma, sans-serif;
    font-size: 10pt;
    color: #2F4F4F;
    }
    A:link {color: #393EFB;}
    A:visited {color: #CC0000;}
    A:active {color: #FF1493;}


    If the entire page is inside a table you'll have to add TD to the BODY style or NS won't display the style- BODY, TD {stuff from above}

    hth

  3. #3
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should stay away from specifying absolute font sizes like points (pt), pixels (px). I suggest use use EM's set your font-size in your body to 1em and then use percentages to resize the font for different styles.

    The reason being is that if you specify a fixed font size like 10pt then it can't be resized in the browser. 10pt is pretty small and some people can't see it. If you use relative sizes they can still resize the text so they can read it. Even if it only helps one person or leads to one sell the 5 minutes it takes to change it in your style sheet is worth it.

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Magazine - MetaQuark Creations (Coming Soon)
    sitepoint@digitalmagician.com

  4. #4
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, the table thing may have been what was causing the problems, since everything is in tables (except the background). IE seemed to be displaying the background image, but I couldn't tell if it was loading the image from cache or not. NS didn't display it at all. Any chance that the server needs to be configured to support css? My host seems not to be configured to support a lot of things. (moving day is coming up shortly )
    Thanks again
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

  5. #5
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got everything working, more or less. The only way I could get the background to display was to add TD to the BODY style, but the background is just a side bar, so then all the cells had that sidebar in them. So, I just went back to putting the background in the webpage itself. Now things will be easier. I'm getting sick and tired of adding <font face="blah, blah, blah," size=-1> to all my table cells.
    thanks
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com


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
  •