0
body {background-color:#080808;}

.Text{
color:white;
text-align:center
}

.titel{
color:red;
font-size:350%;
text-align:center

}

ul.nav
{
list-style-type:none;
text-align:center
padding:0;
position:relative;
left:33%;
}

a:link,a:visited
{
float:left;
margin: 0 auto;
display:block;
font-weight:bold;
color:#FFFFFF;
background-color:red;
width:120px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#E60000;
}

How can I make the a:link, a:visited and a:hover, a:active so it only works on my .nav class?
I don't want all the links I place on my site to become red blocks. only the ones in my .nav class.

hope u guys can help

2
Contributors
1
Reply
16
Views
3 Years
Discussion Span
Last Post by JorgeM
1

You can be more specific in your selectors then. For example...

 ul.nav a { ... }
 ul.nav a:link { ... }

These selectors will only target an him links within your ul elements that have a class of "nav".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.