Schrift
[thread]2149[/thread]

CSS Klassen bilden: .navtab->a



<< >> 3 Einträge, 1 Seite
pktm
 2003-09-27 12:29
#24749 #24749
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Hallo!
Ich habe eine Webseite, in der ich eine Tabellen-Zeile mittels class="navtab" formatiert wird.
In dieser Zeile befinden sich jetzt Links.
Kann ich das mit css so machen, dass ich eine Klasse a.navtab oder a.navtab bilde, mittels derer ich die Links innerhalb der navtab formatieren kann oder muss ich jedem Link einer extra-Klasse zuordnen?
mfg pktm
http://www.intergastro-service.de (mein erstes CMS :) )
macMeck
 2003-09-27 13:34
#24750 #24750
User since
2003-08-04
162 Artikel
BenutzerIn
[default_avatar]
Ja, das geht. Allerdings funktioniert es nicht so, wie man das beim ersten Versuch intuitiv machen würde.
Wenn du ne CSS so definierst:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
.navtab {
color: #00CC00;
}
a.navtab {
text-decoration: none;
color: #0000CC;
}
a {
color: #CC0000;
}
musst du auch deinem Link die Klasse navtab zuweisen <a class="navtab"...>

Wenn du alle Links, die untern einem navtab-Element stehen so formatieren willst, soltest du
Code: (dl )
1
2
3
4
5
6
7
8
9
10
.navtab {
color: #00CC00;
}
.navtab a {
text-decoration: none;
color: #0000CC;
}
a {
color: #CC0000;
}
benutzen. Dann funktioniert es so, wie du es glaube ich gerne haben möchtest.
Siehe auch SelfHTML

HTH

macMeck
It all works, as long as it's documented!
format_c
 2003-09-27 15:32
#24751 #24751
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Also ich würde das getrennt machen.
Immer Klassen explizit dafür anlegen wofür man sie auch verwenden will.
So schleichen sich weniger unerklärliche Fehler ein und man gerät nicht so schnell in Namensnot.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
a	  { color : #37496D; }
a:link { color : #37496D; text-decoration : none; }
a:visited { color : #37496D; text-decoration : none; }
a:hover { color : #37496D; text-decoration : underline; }
a:active { color : ò¢°ª text-decoration : underline; }

/* Links der Klasse test */
a.test { color : � }
a.test:link { color : � text-decoration : none; }
a.test:visited { color : � text-decoration : none; }
a.test:hover { color : േ text-decoration : underline; }
a.test:active { color : #ffe080; text-decoration : underline; }

/*Standardschrift des Bodies*/
body {fontsize: 12px; font-family: arial,helvecita; font-color: 񑘕 font-weight: normal;}

/*Standard Style für Tabellen */
table, tr, td {font-size: 13px;....}

/*Style für eine spezielle Tablellenzeil Zeile*/
tr.test {font-size: 12px;....}

/*Style für einen InputField */
input.test {color: � background:'images/image.gif';}


So ungefähr tät ich einen Stylesheet aufbauen.

Gruß Alex
<< >> 3 Einträge, 1 Seite



View all threads created 2003-09-27 12:29.