Results 1 to 6 of 6

Thread: i thnk this is css

  1. #1
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default i thnk this is css

    i have a site, and want to make all the fonts throughout the whole thing the same, and want to be able to change all of them in 1 place. i know this is possible, but cant find out how. this also applies to colors for tables and such. thanks

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by spyder
    i have a site, and want to make all the fonts throughout the whole thing the same, and want to be able to change all of them in 1 place.
    You need to link a style sheet into you documents:

    HTML Code:
    <link rel="stylesheet" type="text/css" href="...">
    The .css file identified in the href attribute can now be used to suggest presentation for all of the documents that include it.

    The rule

    Code:
    body {
      font: 100% sans-serif;
    }
    will change the 'body text' (nothing to do with the body element: normal text that appears in paragraphs, tables, etc.) to a generic sans serif font. You can suggest more specific type faces by including a comma-separated list of font family names, like Arial and Lucida Sans. If the family name contains spaces, you need to quote it with either single or double quotes. For example,

    Code:
    body {
      font: 100% 'Lucida Sans', Arial, sans-serif;
    }
    The order of the names reflects preference: if Lucida Sans is available it will be used, if not then the user agent will try Arial. If neither is available, it will use its generic alternative. You should always specify a generic family name, just in case.

    Mike
    Last edited by mwinter; 05-30-2005 at 07:06 PM.

  3. #3
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you

  4. #4
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for that, another thing is that if i want the font for linkks, can i also specify that there is no color change. i want it to always be white. thank you again

  5. #5
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry, i am very very new at css. how would you specify the size of the font

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Rather than asking questions in a piecemeal fashion, might I suggest you stop whatever it is you're trying to do and learn CSS thoroughly. Having myself, or others, passing along tidbits of advice won't help you in the long run, but leave you running backwards and forwards every time you need assistance with the next little thing. I'm not trying to be mean, so don't take it that way, but you can't hope to be productive if you carry on this way.

    Quote Originally Posted by spyder
    if i want the font for linkks, can i also specify that there is no color change.
    You can, but you should be wary of doing so. Unless it's obvious - and I mean to strangers, not you - that some content is a link, you should always make sure that links are distinct from everything else.

    To style a link, you need to use a specific selector (that is, a selector which explicitly identifies an a element) in order to override the user agent's default style sheet.

    Code:
    a {
      background-color: ...;
      color: white;
    }
    Whenever you set colours, you should always set both the background any foreground colour simultaneously, otherwise a user agent with an unexpected default colour combination may render your page unreadable.

    how would you specify the size of the font
    If you're specifying a type face at the same time, you can set the size using the shorthand font property.

    Code:
    font: 100% sans-serif;
    Font sizes are best expressed as percentages (of the user's default) and should not go lower than 85% in the vast majority of cases. However, you can use other units. The size will always go before the family list.

    Mike

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
  •