Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a:active in CSS

Status
Not open for further replies.

estrellas

Programmer
Jul 16, 2004
48
US
Hi guys -
I'm working with dreamweaver to do a website and stuff .. and I'm trying to make it so when a user is on a page, the link is hilighted a different color, then when he gets off that page, it goes to the a:visited color.

as far as i know, the command for it in the css sheet is a:active ... this doesn't work though .. here's my css .. any reasons why and any help would be totally appreciated. thanks much!

PHP:
.menu a{
	display: block;
	font-variant: normal;
	font-weight: normal;
	font-size: 11px;
	position: relative;
	border-color: #6633FF;
	text-align: center;
}
td#menu a:hover {
	background-color: #8DAAF3;
	border-color: #6633FF;
	color: #00229D !important;
}
td#menu a:visited {
	color: #00229D !important;
	border-color:#6633FF;
}
td#menu a:active {
	color: #00229D !important;
	background-color: #8DAAF3;
}

-------
 
are the
PHP:
 bits in your style sheet ???



Chris.

Indifference will be the downfall of mankind, but who cares?
[URL unfurl="true"]www.candsdesign.co.uk[/URL] A website that proves the cobblers kids adage.
[URL unfurl="true"]www.cram-system.com[/URL] Nightclub counting systems

So long, and thanks for all the fish.
 
uhh .. no .. i'm not retarded ... idid the
PHP:
 tags around it cos i wasn't sure if the forum took [php] or [code] ......................

-------
[URL unfurl="true"]www.letour.fr[/URL]
 
Had to ask. wouldn't be the first time

however I don't suppose having !important; in the definition does much for the CSS syntax.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
i dont' wanna get too mad or mean here .. but sorry hun .. !important does a lot for CSS .. maybe next time only post if you're 100% sure about something? i dunno .. whatever. thanks for trying though :) cheers

-------
 
but after all that you would be better assigning a class to the a element


a.menu:link {... etc
and use <a class="menu" ... etc

because each element on a page should have a unique id attribute and by using td#menu you would have to have ALL your <td>s with a menu link in to have the attribute id="menu".



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
aghhhhh estrellas
don't bite the hand that feeds you!
I know that ChrisHirst will not say much in his defence here but I can't let this one go knowing how many great posts he has contributed....soooo
maybe YOU should post next time only when ur 100% sure how tags get processed here....besides, did u not see the link "Process TGML" 0.5 cm above Submit button?[nosmiley]


In other words, sometimes we all rush into posting...[peace]

Chris gave u good advice....assign elements to cells/rows since u would end up with all of your TDs rolling over throuhgout the page.
Also, u might consider differnt approach to each link in a manner of a block vs. using table parts.
Take a look at quick & dirty sample:
take it:

All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top