SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Addict 95 Degrees's Avatar
    Join Date
    Jan 2001
    Location
    Jamaica
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Links-2 colors needed, same page-How?

    On some pages I have tables, some with dark backgrounds, some with light. I therefore need to have 2 link attributes on the same page. How do I do that.

    For example: I have
    a:link { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFFFF }
    a:visited { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFF00 }

    Links are light colored so for text in tables which have white as a background (on same page) these links do not show up as there is no contrast. How do I have 2 different link color attributes on same page? !

    Thanks in advance for any help you can offer a newbie to CSS

  2. #2
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're using Dreamweaver this is a good tutorial: http://www.thepattysite.com/dreamwea...nkstyles3.html

  3. #3
    Non-Member Kelar's Avatar
    Join Date
    Jul 2001
    Location
    Holland
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CSS Links-2 colors needed, same page-How?

    Originally posted by 95 Degrees
    On some pages I have tables, some with dark backgrounds, some with light. I therefore need to have 2 link attributes on the same page. How do I do that.

    For example: I have
    a:link { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFFFF }
    a:visited { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFF00 }

    Links are light colored so for text in tables which have white as a background (on same page) these links do not show up as there is no contrast. How do I have 2 different link color attributes on same page? !

    Thanks in advance for any help you can offer a newbie to CSS
    You should start using classes then. With classes, you can make multiple link-styles for one page. This is how you use them:
    Code:
    a.menu			{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.menu:active		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.menu:visited		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.menu:hover		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000000}
    
    a.link			{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.link:active		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.link:visited		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000099}
    
    a.link:hover		{text-align: left;
    			 font-family: verdana;
    			 font-size: 8pt;
    			 font-weight: bold;
    			 color: #000000}
    In your HTML-page, you call a class by refering to it like this:

    Code:
    <a href="yourpage.html" class=link>Link</a>
    
    and
    
    <a href="otherpage.html" class=menu>Next Link</a>
    I hope this helps you out a bit, if you have any problems, just ring a bell .

  4. #4
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This one should be in the FAQ.

  5. #5
    SitePoint Addict 95 Degrees's Avatar
    Join Date
    Jan 2001
    Location
    Jamaica
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Better Late tha Never

    Somehow I did not get back here to say thanks....so here it is now! This helped me out.


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
  •