PDA

View Full Version : Resolved can you links in div with css?



ptsiii
Jan 19th, 2010, 04:30 PM
Is there a way to style links in a specific div differently than links in the rest of a page using css?

j05hr
Jan 19th, 2010, 04:37 PM
HTML


<li class="footer"><a href="index.php">Home</a></li>


CSS


.footer a:link, a:visited {
color: #fff; text-decoration:none;
}
.footer a:hover, a:active {
color: #fff; text-decoration:underline;
}


So you give it a class in the HTML and then you name it in the CSS and then style it as you would a normal link.

masterofollies
Jan 19th, 2010, 04:50 PM
as j05hr shows. Add class="" to your div tags, and add the class name and values in the css file.

ptsiii
Jan 19th, 2010, 05:19 PM
thanks for the help. perfect answer. and it helped me understand the purpose of classes with css.... thanks again.