Marvin Lerousseau Marvin Lerousseau - 4 months ago 63
CSS Question

Bootstrap - Change the color of visited links

I would like that all the links change their color when they are visited. I am working with Bootstrap and this is what I have tried so far (that doesn't work properly) :

<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="unicode">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="" rel="stylesheet">

<!--[if lt IE 9]>
<script src="//"></script>
<link href="" type="text/css" rel="stylesheet">

<style type="text/css">
color:#d99a30 !important;
&:hover{ color:#37404e !important;}
&:visited{ color:#37404e !important;}
<div class="container">
<div class="col-md-8 col-md-offset-2">
<div class="row">
<div class="col-sm-12">
<h3><a href="some_link.html">Link</a></h3>

Thanks for your help


You are using the syntax for LESS/SASS instead of plain CSS. Here is an example of your code using CSS.

a { color:#d99a30 !important; }
a:hover { color:#37404e !important; }
a:visited { color:#37404e !important; }

If you want :hover and :visited to be the same, you can also simplify that rule too:

a { color:#d99a30 !important; }
a:hover, a:visited { color:#37404e !important; }