SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Need help with simple stylesheet PLEASE!!!

    I am creating a site:

    http://www.cywebsites.com/beley/host...wer/index.html

    I am trying to create a stylesheet that will allow me to have two different link colors... one for the body {dark color text (333333), dark blue links (003366)} and the footer {white text with white links)

    Does anyone know how I can accomplish this? I'm very new to stylesheets but I think this is the only way. I'd like it to be a linked or global SS because there are a lot of pages.

    Any help would be greatly appreciated!

  2. #2
    SitePoint Enthusiast ben_washington's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    You must use classes for what you are wanting:

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

    a.blue:link{color:#003366}
    a.other:link{color:#566745}
    -->
    </style>

    <body>

    <a href="wherever" class="blue">A link</a>
    <a href="wherever" class="other">Another link</a>

    </body>

    Remember that you can make some nice text rollover effects with CSS:

    a.rollover:link{color:#000000;}
    a.rollover:hover{color:#ff0000;}

    <a href="something.net" class="rollover">Hover over this link and it will turn red!</a>

    Hope Ive helped

  3. #3
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's another method you can use:

    .html:
    <div id="body">
    ..body..
    </div>
    <div id="footer">
    ..footer..
    </div>

    .css:
    #body A:whatever {whatever}
    #footer A:whatever {whatever}

  4. #4
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You guys are great! I'm going to get this CSS thing if it's the last thing I do!

    I'm going to try that... Thanks!

  5. #5
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I think I got it working now... check it out:

    http://www.cywebsites.com/beley/host...wer/index.html

    I'm just starting with CSS so I'm not going to try anything fancy. Just the basics to get the job done (and b/c this is for a 'client' and I don't want to experiment on him) - I'll try more when I get my personal website up and running.

    Thank you both for the quick replies. I really appreciate it!

  6. #6
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I shouldn't've said anything, I'm in that contest too.

    Just kidding. Really, CSS is great. I removed about a kilobyte of <font> tags from my tables and added one font class in CSS to do the job. It worked seamlessly. Now if only Netscape would implement it...

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Netscape does implement CSS for the most part. Even version 4.x. It is limited in it's application but MOST common CSS declarations will work.

    Font-family, font-size, font-weight, color, etc...

    All of the above work just fine in Netscape 4.7 (the version I test with).

    Take a look here for reference:
    http://www.projectcool.com/developer...css_style.html
    and
    http://www.richinstyle.com/bugs/table.html
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    thanks guys, you can see their new site at www.hostinganswer.com. We're still putting content in but it's done for the most part.

    Much appreciation for the help!

  9. #9
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One thing I'd like to point out here is that using delemtri's method will make further nested CSS very difficult if not impossible. Instead of using id, use class. The difference is id uses
    #idname
    vs class that uses
    .classname
    You can still use <span class="classname"> or <div class="classname"> and still do
    .classname A:link { color: #888888; }
    .classname A:hover { color: #999999;}
    etc.
    Kevin


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
  •