SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Location
    San Antonio, TX
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is CSS the answer?

    Hey everyone, I'm new to the board but have a question: I have heard that incorporating CSS into a site can allow easier management when it comes to changing text colors, backgrounds, link colors etc. Is there a way of setting it up so that it only controls the background image, ALINK/VLINK/LINK colors, and text colors only rather than modifying frames and everything else? Also, if you have CSS implemented I know that you can make one change and it will distribue the change to be active in all pages, but do you have an external CSS file that is embedded into the HTML itself? Please help.
    Thanks,
    bhoberg

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well first off, welcome to Sitepoint.

    To answer your question, yes. CSS can do all of what you want and more. Here's how a basic stylesheet would look for your needs:

    <style type="text/css">
    <!--

    /* these are the styles for your links. They should be self-explanatory */
    a:link { color: #000000; font-size: 9pt; font-weight: bold;}
    a:hover { color: #FFE301; font-size: 9pt;}
    a:visited { color: #000000; font-size: 9pt;}
    a:visited:hover { color: #FFE301; font-size: 9pt;}

    /* This will change the text properties of any element of text that lives inside of one of these container elements */
    div, p, td { font-family: verdana; font-size: 9pt; color:#000000; font-weight: bold; }

    /* This will set your background properties */
    body { background: url(chess.png) gray 50% repeat fixed }
    (refer to this page for more information on Background:
    http://www.w3.org/TR/REC-CSS1#color-...und-properties)

    -->
    </style>

    Just copy that and paste it into a blank text file. Name it styles.css or whatever file name you want (but the extension must be CSS). Then, from within any HTML page you want to be affected by the stylesheet, place this line of code:
    <link rel="stylesheet" href="fragments/styles.css">

    Where styles.css corresponds to the name of your stylesheet document.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Note that if you place this text into a CSS file, you won't need the top or the bottom 3 lines. Basically you'll only need the actual style declarations.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •