|
|
#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 |
|
|
|
|
|
#2 (permalink) |
|
Senior Member
Super #1
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.
__________________
|
|
|
|
|
|
#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 |
|
|
|
|
|
#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>
|
|
|
|
|
|
#5 (permalink) |
|
after g, before i
Resident.
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=""> |
|
|
|
|
|
#7 (permalink) |
|
Senior Member
Super #1
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>
__________________
|
|
|
|