Apply Pseudo-Classes to a Div

I have a div called main and I cannot remember how to write the code to apply a pseudo-class for links to that "main" div
main.a:link {
	color:#000;
	background-color: #fff;
}
main.a:visited {
	color:#cc0000;
	background-color:#ffcc00;
}
main.a:hover {
	color:#ffff00;
	background-color:#cc0000;
}
main.a:focus{
	color:#cccccc;
	background-color: #666666;
}
main.a:active {
	color: #cc3300;
	background: #ffff99;
}

Open in new window

I know that is wrong but I have tried a few variations with no luck.

Thank you,
LVL 29
coreybryantAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SSupremeConnect With a Mentor Commented:
. is for class,
# is for ID,
nothing is for html attributes.
So if main is ID it should be like this:
#main a:link {...
If main is class itshould be like this:
.main a:link {...
0
 
coreybryantAuthor Commented:
Thanks, that was it
0
All Courses

From novice to tech pro — start learning today.