Font color for links

Re: Font color for links

by Urs Hunkler -
Number of replies: 0
Picture of Core developers

Hi Shaan,

all sideblocks have the CLASS ".sideblock" and the Navigation bar has the class ".breadcrumb". So you can use the CSS descendant selectors to specify the place and then the property you want to style: the place for example is defined by ".sideblock" and the property is "a:link":

.sideblock a:link,
.breadcrumb a:link {
    color: red   /* unvisited links */
}
.sideblock a:visited,
.breadcrumb a:visited {
    color: blue   /* visited links   */
}

and so on with if you need them:

a:hover   { color: yellow } /* user hovers     */
a:active  { color: lime }   /* active links    */

An example you can see in the "Footer" section of the CSS file "styles_color.css" of the the standard theme.

@Aurora - your example works if you are writing the web pages. To modify the link classes in Moodle you would have to patch the code. With the descendant selectors this is not necessary.