• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

CSS verkürzen

Status
Für weitere Antworten geschlossen.

Ay Chiquita

Neues Mitglied
Hallo!

Mal schauen, ob ich es schaffe, mein Problem in Worte zu fassen:
Ich habe einige <span>-styles mit CSS definiert. In vielerlei Hinsicht ähneln sich die einzelnen <span>-styles, z.B. in der Schriftart.

Code:
.a1 { color:#666666; font-family: arial, helvetica, sans-serif; font-size:10px; }
.a2 { color:#666666; font-family: arial, helvetica, sans-serif; font-size:12px; }
.b1 { color:#B12605; font-family: arial, helvetica, sans-serif; font-size:10px; }
.b2 { color:#B12605; font-family: arial, helvetica, sans-serif; font-size:12px; }
.b3 { color:#B12605; font-family: arial, helvetica, sans-serif; font-size:16px; }
.c1 { color:#FFFFFF; font-family: arial, helvetica, sans-serif; font-size:10px; }
.c2 { color:#FFFFFF; font-family: arial, helvetica, sans-serif; font-size:12px; }
Das möchte ich kürzen. Da alle dieselbe Schriftart haben, könnte man das doch als ein Kriterium wählen, dann könnte man als nächstes Kriterium die Schriftfarbe wählen usw., sodass das einzige, was am Ende noch hinter ".a1"-".c2" steht, die Schriftgröße ist. Wie mach ich sowas?

e:// Hab die Punkte vergessen :p
 
Zuletzt bearbeitet:
Werbung:
Hallo erstmal!
Gleich als erstes ne Frage von mir: gibts nen html-tag, dass c1 oder b1 heißt? Du musst schon bei jedem die SChriftart wählen, allerdings kannst du in dem Body deine SChriftart wählen.. Beispiel:
HTML:
body{font-family: arial, helvetica, sans-serif;}
Dann bräuchtest dus nich immer wieder neu hinschrieben.. mehr fällt mir dazu im Moment nicht ein..
Gruß, Fredmonster!
 
@Fredmonster: Da gehörten eigentlich noch Punkte davor.

@Ay Chiquita:
Ich würde das so machen:
Code:
.a1, .a2, .b1, .b2, .b3, .c1, .c2  {font-family: arial, helvetica, sans-serif; font-size:10px;}
.a1 {color:#666666;}
.a2 {color:#666666; font-size:12px; }
.b1 {color:#B12605;}
.b2 {color:#B12605; font-size:12px; }
.b3 {color:#B12605; font-size:16px; }
.c1 {color:#FFFFFF;}
.c2 {color:#FFFFFF; font-size:12px; }
 
Werbung:
Status
Für weitere Antworten geschlossen.
Zurück
Oben