Wednesday, November 24, 2010

Change link html color in a different div box?

The link color for the page is white, however, in the footer, i need it to be a shade of blue. How do i change this code to reflect that?



.footer {

float: left;

width: 971px;

text-align: center;

padding-top: 10px;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0058C2;

}Change link html color in a different div box?a is the element tag for anchor (links). Just add an a in front of the class for the div tag and all the a (anchors) in that section will take on this styling.



a.footer {

color: #0058c2;

}



And also add:



.footer {

float: left;

width: 971px;

text-align: center;

padding-top: 10px;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}



to mark up the rest of the tag.Change link html color in a different div box?The effects are as follows:



a:link (what the color is normally)

a:visited (what the color is after they've clicked on the link)

a:hover (what the color is when they hover the mouse over the link)

a:active (what the color is for an active link)



There are different ways of doing this with the same result, but I'll post this one so that you can play with it and see how it works.



I've created a class, %26quot;footerLink%26quot;. Here is the css:



a.footerLink:link{

color:#0066CC;

}



a.footerLink:visited{

color:#FFFFCC;

}



a.footerLink:hover {

color:#996600;

}



a.footerLink:active{

color:#999999;

}



In this example, your links need to contain the class %26quot;footerLink%26quot;



%26lt;a class=%26quot;footerLink%26quot; href=%26quot;http://URL.htm%26quot;%26gt;Link Text%26lt;/a%26gt;



Also, you may want to consider sticking with web colors only since it may look blue to you, on your screen, but can show up purple elsewhere. Just a suggestion.



Hope this helps!