[html] id's en classes

Pagina: 1
Acties:

  • Shagura
  • Registratie: Augustus 2001
  • Laatst online: 12-09 23:01
Zie voorbeeld:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<html>
<head>
<title>geheimpje</title>
<STYLE TYPE="TEXT/CSS">
BODY { SCROLLBAR-BASE-COLOR: #646464; SCROLLBAR-ARROW-COLOR: #FEC254; } 
#bg A:link, #bg A:visited, #bg A:active { COLOR: #000000; TEXT-DECORATION: none; }
#bg A:hover { COLOR: #FFFFFF; TEXT-DECORATION: none; } 
.toptext { FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; COLOR: #CEBF9C; }
.link { COLOR: red; }
.link:hover { COLOR: blue; }
</STYLE>

</head>
<body bgcolor="#312310" text="#000000" bgproperties=fixed id="bg">
<span class="toptext"><b>» Blaat.</b> Blaat <a href="nix">normale zwarte link</a>
<a href="blaat.html" class=link>Deze moet rood worden @*(#&()@*#&</a>.</span>
</body>
</html>

De body heeft een id (bg) en daarin moeten alle links zwart worden. Maar nu heb ik één (of meerdere) links die een andere kleur moeten worden, namelijk rood. Met een class lukt het niet, omdat de body id schijnbaar voorgaat. Heeft hier iemand een oplossing voor?

(Ik heb gezocht, maar weet niet goed waarop ik moet zoeken)

  • crisp
  • Registratie: Februari 2000
  • Laatst online: 09:38

crisp

Devver

Pixelated

Waarom geef je je body een id; is IMHO helemaal niet nodig. Verder ben je niet erg consequent in het gebruik van lower/uppercase. lowercase heeft bij mij meestal de voorkeu omdat het 'rustiger' aandoet.
Bekijk dit stukje maar eens:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<title>geheimpje</title>
<style type="text/css">
body {
 scrollbar-base-color: #646464;
 scrollbar-arrow-color: #FEC254;
 background-color: #312310;
 color: #000000;
}
A, A:link, A:visited, A:active {
 color: #000000;
 text-decoration: none;
}
A:hover {
 color: #FFFFFF;
 text-decoration: none;
} 
A.link {
 color: red;
}
A.link:hover {
 color: blue;
}
.toptext {
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 11px;
 color: #CEBF9C;
}
</style>
</head>
<body>
<span class="toptext"><b>» Blaat.</b> Blaat <a href="nix">normale zwarte link</a>
<a href="blaat.html" class="link">Deze moet rood worden @*(#&()@*#&</a>.</span>
</body>
</html>

bgproperties eruit gelaten omdat er toch geen background plaatje is. Anders kan je dit ook in je css zetten dmv:
code:
1
2
background: url(blaat.gif);
background-attachment: fixed;

Intentionally left blank


  • wicher|IA
  • Registratie: November 2000
  • Laatst online: 10-04-2023
ipv
code:
1
2
a:link, a:active, a:visited { }
a:hover { }

kun je ook gewoon dit doen hoor:
code:
1
2
a { }
a:hover { }

:z

verder wat crisp zei

  • Dennis
  • Registratie: Februari 2001
  • Laatst online: 09:41

  • Shagura
  • Registratie: Augustus 2001
  • Laatst online: 12-09 23:01
het is van een forum, waar ik het een en ander van heb ge copy-paste. Daar zaten al die 'fouten' dus in :D
maa ik ben er al uit, bedankt iedereen