icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old August 25th, 2004, 6:32 PM   #1 (permalink)
Surpass Fan
On a golden path...
 
Joined in Jul 2004
372 posts
Gave thanks: 0
Thanked 0 times
External CSS, + Links

I know with CSS you can do this:

a:visited {color:yellow; text-decoration: none}
a:link {color: red; text-decoration: none}
a:hover {color: green; text-decoration: none}

But can I have say a certain link color in a certain DIV tag?

#maincontent {margin-left: 6;margin-right: 6;}

that is my main css style
can i make it so that div tag link color is different than the other pages? If so, can you please tell the code?
thanks
darkzeroman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 25th, 2004, 7:03 PM   #2 (permalink)
Rai
Senior Member
Super #1
 
Rai's Avatar
 
Joined in Nov 2003
Lives in Canada
Hosted on Pass14
3,770 posts
Gave thanks: 4
Thanked 20 times
Alrite, I'm trying to understand what you're trying to do... I get the first part...

To change the link colour to a certain div tag, you should use something like:

a.maincontent:link, a.maincontent:active, a.maincontent:hover, a.maincontent:visited {
color: #000000; text-decoration: none; }

or if you want them to be all different, just split it up like you have the regular link code.

Now I'm a little confused about your second question... Do you mean you want the #maincontent div to have links of one colour on one page, but a different colour on another? If that's the case and you're using an external css template, I don't think it's possible. Your only choice that I know of would be placing the css coding in the page itself.

Of course, another option would be to change the name of the div tag, and create new values for this one. (ie #maincontent2 with different link colours)

Oh, and just a little advice... you really should use the HEX colour codes, not the written value.. For some basic HEX codes, you can look at: http://adams.htmlplanet.com/hex.htm or do a search for HEX Colour Charts.
__________________
Rai is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 25th, 2004, 7:52 PM   #3 (permalink)
Registered User
Seasoned Poster
 
Joined in Jul 2004
31 posts
Gave thanks: 0
Thanked 0 times
If I understand what you're asking for correctly ... you have a page with various DIVs in one of which contains the main block of text or content of your site. You want all the links on the page to be in one colour apart from the ones inside that block.

Luckily what you want to do is very easy because CSS works on the principle that more specific CSS properties over-ride less specific ones.

Therefore:

a {color: red;}
#maincontent a {color:blue;}

Will make all the links within the #maincontent DIV blue whilst leaving all the other links red.

-wolf
Wolfy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 26th, 2004, 11:12 PM   #4 (permalink)
Surpass Fan
On a golden path...
 
Joined in Jul 2004
372 posts
Gave thanks: 0
Thanked 0 times
Sry for the confusion...

sry for the confusion...here is my style, (its external)

Code:
 <style>
BODY{scrollbar-base-color: 000000;
	      scrollbar-face-color: #047B1A;
	      scrollbar-highlight-color: #037B10;
	      scrollbar-shadow-color: #000000;
	      scrollbar-dark-shadow-color: #FFFFFF;
	      scrollbar-track-color: #858585;
	      scrollbar-arrow-color:white}


a:visited {color:yellow; text-decoration: none}
a:link {color: red; text-decoration: none}
a:hover {color: green; text-decoration: none}
#boxhead  {margin-left: 6;margin-right: 6;margin-top: 5; font-size:10; font-family:Verdana, Arial, Helvetica, sans-serif; color:white;}
#boxcontent {color:red; margin-left: 7; margin-bottom: 2; margin-top: 1; margin-right:5; font-size:10; font-family:Verdana, Arial, Helvetica, sans-serif;}
#maincontent {margin-left: 6;margin-right: 6;}
#wholetable {margin-top: 9; margin-left: 13;}
.maintitle  {color:black; font-weight: 800; font-family:Arial, Helvetica, sans-serif; left:auto; margin-left: 8px; font-size: 16px; margin-top:5px; margin-right:8;}
.maintext  {color:black;font-family:Arial, Helvetica, sans-serif; left:auto; margin-left: 8px; margin-right:8; font-size: 12px;}
.mainpostdate	{color:black;font-family:Arial, Helvetica, sans-serif; left:auto; margin-left: 8; font-size: 10px; text-align:right;  margin-right:8;}
.basetext	{color:black;font-family:Arial, Helvetica, sans-serif; margin-left: 8; font-size: 12px; margin-right:8; font-weight:bold;}
.texthead	{color:white;font-family:Arial, Helvetica, sans-serif; margin-left: 8; font-size: 14px; margin-right:8; font-weight:bold; background-color: #000099; text-align:center;}

</style>
the box ones are my navigation and my main are my pages texts. What I want are the links of the navigation(box styles) a different color and the main(main styles) a different color. I tried both of your ways, but I cant get it.
darkzeroman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 26th, 2004, 11:18 PM   #5 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,089 posts
Gave thanks: 48
Thanked 131 times
If you're using an external CSS file you do not need to have the <style> tag.

In the link you may have to specify the style. such as:
Code:
<a href="link.html" class="2ndlinkstyle" alt="">
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 26th, 2004, 11:20 PM   #6 (permalink)
Surpass Fan
On a golden path...
 
Joined in Jul 2004
372 posts
Gave thanks: 0
Thanked 0 times
yeah i know....i'll fix it later once i can get the different color links
darkzeroman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old August 26th, 2004, 11:24 PM   #7 (permalink)
Rai
Senior Member
Super #1
 
Rai's Avatar
 
Joined in Nov 2003
Lives in Canada
Hosted on Pass14
3,770 posts
Gave thanks: 4
Thanked 20 times
The thing about my way, I realized it afterwards, you have to put the class in the link code itself...

such as <a href="link.htm" class="maincontent">Link Text</a>
__________________
Rai is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On