webForumDet fria alternativet

olika länkar med olika active och hover

HTML & CSS

2 svar · 333 visningar · startad av daniel_ra

Medlem sedan jan. 2002381 inlägg
Frågan#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.

Medlem 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>
Medlem sedan jan. 2002381 inlägg
#3

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

248 ms totalt · 4 externa anrop · v20260731065814-full.86ec41c2
120 ms — deklarationer (db)
0 ms — hämta statistik (cache)
125 ms — hämta tråd, inlägg och bilagor (db)
117 ms — ändringar (db)