I am trying to add the hover pseudoclass and apply the following styles:
Background color must be #eee
Use gray for font color
I have done it in two ways:
#container :hover {
background-color: #eee;
color: gray;
}
</style>
</head>
<body>
<div id="container">
<a href="#">link</a>
<a href="#">link</a>
<a href="#">link</a>
<a href="#">link</a>
<a href="#">link</a>
</div>
The other one is by selecting div
.
div :hover {
background-color: #eee;
color: gray;
}
The problem is the last one changes the background color but not the font color. I can not understand what is going on.