verschiedene pseudoformate in einer datei definieren
torsten
- css
hallo,
ich möchte das in einer seite verschiedene links verschieden definiert werden. ich habe es mal so probiert: (nur mal als beispiel)
<style type="text/css">
<!--
#verweis1 {
a:link { color: #FFFFFF; text-decoration: none; font-weight: bold; font-style:italic }
a:visited { color: #FFFFFF; text-decoration: none; font-weight: bold; font-style:italic }
a:active { color: #FFFFFF; text-decoration: none; font-weight: bold; font-style:italic }
a:hover { color: #ADD8E6; text-decoration: underline }
}
#verweis2 {
a:link { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:visited { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:active { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:hover { color: #ADD8E6; text-decoration: overline }
}
-->
</style>
<div id="verweis1"><a href="verweis1.htm">verweis1</a></div>
<div id="verweis2"><a href="verweis2.htm">verweis2</a></div>
nun ja so funktionierts leider nicht. ist es überhaupt möglich verschiedene pseudoformate in einer datei zu definieren? wenn ja, wie? würde mich über vorschläge freuen.
gruß
torsten
Hi,
#verweis1 {
a:link {
das klappt nicht, ungültige Grammatik. Benutze den Enkelselektor, also das Leerzeichen: "#verweis1 a:link".
a:visited { color: #FFFFFF; text-decoration: none; font-weight: bold; font-style:italic }
a:active { color: #FFFFFF; text-decoration: none; font-weight: bold; font-style:italic }
a:hover { color: #ADD8E6; text-decoration: underline }
a:link { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:visited { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:active { color: #000000; text-decoration: none; font-weight: bold; font-style:italic }
a:hover { color: #ADD8E6; text-decoration: overline }
Hyperredundanz. Definiere ein einziges Mal die wiederholten Eigenschaften, gib nur die "individuellen" separat an. Also
a:link { text-decoration:...; font-weight:...; font-style:...; }
a:hover { text-decoration:...; }
#verweis1 a:link { color:...; }
#verweis2 a:link { color:...; }
#verweis2 a:hover { color:...; }
That's it.
Cheatah
hi Cheatah,
dank dir es funktioniert....
Hi,
das klappt nicht, ungültige Grammatik. Benutze den Enkelselektor, also das Leerzeichen: "#verweis1 a:link".
Nachkommen, nicht Enkel (Enkel sind zwar immer auch Nachkommen, aber Nachkommen nicht immer Enkel.
Enkel wäre
element>*>grandchild
cu,
Andreas