Saite ar klasi CSS
Lai tagad pašām saitēm būtu klase:
<a href="#" class="eee">saite</a>
<a href="#" class="eee">saite</a>
<a href="#" class="eee">saite</a>
Uzstādīsim stilus saitēm, kurām ir šāda klase:
a:link.eee, a:visited.eee {
color: red;
}
a:hover.eee {
text-decoration: none;
}
Nav nozīmes, kādā secībā rakstīt saites klasi un stāvokļa pseidoklases. Var tos pārkārtot vietām, un nekas no tā nemainīsies:
a.eee:link, a.eee:visited {
color: red;
}
a.eee:hover {
text-decoration: none;
}
Pastāstiet, ko atlasa selektors dotajā zemāk redzamajā kodā. Pēc tam uzrakstiet HTML kodu, kas atbilst šim selektoram. Lūk, kods ar selektoru:
a.zzz {
color: red;
}
a.zzz:hover {
text-decoration: none;
}
Pastāstiet, ko atlasa selektors dotajā zemāk redzamajā kodā. Pēc tam uzrakstiet HTML kodu, kas atbilst šim selektoram. Lūk, kods ar selektoru:
#block a.zzz {
color: red;
}
#block a.zzz:hover {
text-decoration: none;
}
Pastāstiet, ko atlasa selektors dotajā zemāk redzamajā kodā. Pēc tam uzrakstiet HTML kodu, kas atbilst šim selektoram. Lūk, kods ar selektoru:
.block a.zzz {
color: red;
}
.block a.zzz:hover {
text-decoration: none;
}