How to change links in CSS?

What CSS example code, applied to a container, can change the color of any links inside it?

  • I need to change the links in a container without having to apply the class to each <a> tag. I also don't want to alter link colors for the whole page -- just inside the specified container.

  • Answer:

    give your container a name - like an ID ... <div id="myContainerName"> your text and <a href="answers.yahoo.com">links</a> go here </div> ... and then your CSS just looks like this ... <style type="text/css"> #myContainerName a {color: red;} </style> ... this style rule reads like all "a" tags (links) inside a thing (container) with id of "myContainerName" should be red good luck!

ZenBlend... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Give a look C##...{:-{}.

slvrfx24

An example: #footmenu a:link {color: #0000ff;} #footmenu a:hover { color: #0000CC; text-decoration: underline overline; background-image: url(menubar.png);} #footmenu a:visited {color: #0000ff;}

Interested Dude

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.