webForumDet fria alternativet

olika länkar med olika active och hover

HTML & CSSur HTML, XHTML & CSS

2 svar · 333 visningar · startad av daniel_ra

daniel_raMedlem sedan jan. 2002381 inlägg
#1

Jag skulle vilja styra utseendet på alla mina länkar med css. Jag har dock ett problem. Eftersom min bakgrund består av olika färger kan jag inte ha samma färg på alla länkar eftersom de då inte skulle synas mot bakgrunden.

exeplelvis vill jag att vissa länkar skall se ut såhär:

A:link { text-decoration: none; color: blue}
A:active { text-decoration: none; color: blue}
A:visited { text-decoration: none; color: blue}
A:hover { text-decoration: none; color: red}

och andra såhär

A:link { text-decoration: none; color: red}
A:active { text-decoration: none; color: red}
A:visited { text-decoration: none; color: red}
A:hover { text-decoration: none; color: blue}

går detta att lösa på något vis..

väldigt tacksam för hjälp.

MatteMedlem sedan aug. 20002 975 inlägg
#2

Du får använda class i dina länkar t.ex såhär:

CSS-koden:

A.typ1:link { text-decoration: none; color: blue} 
A.typ1:visited { text-decoration: none; color: blue} 
A.typ1:hover { text-decoration: none; color: red}
A.typ1:active { text-decoration: none; color: blue} 

A.typ2:link { text-decoration: none; color: red} 
A.typ2:visited { text-decoration: none; color: red} 
A.typ2:hover { text-decoration: none; color: blue} 
A.typ2:active { text-decoration: none; color: red}

Och sedan två länkar med olika utseende:

<a href="sida1.html" class="typ1">Blå länk</a>
<a href="sida2.html" class="typ2">Röd länk</a>
daniel_raMedlem sedan jan. 2002381 inlägg
#3

tack så jättemycket.. har slitet för att komma på hur jag ska göra !!!

133 ms totalt · 3 externa anrop · v20260731065814-full.29ac60f6
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
129 ms — hämta tråd, inlägg och bilagor (db)