2 * CSS in einer html

Status
Nicht offen für weitere Antworten.

SecondRealm

Mitglied
moin,
ist es möglich in eine html datei 2 verschiedene css styles einzubringen (der 2te sollte nur für eine tabelle gültig sein)?
mfg
 
natürlich
musst nur aufpassen, dass sich die styles nicht überschneiden, denn wenn sie das tun, wird nur der letzte verwendet (also der style von der datei, die du zuletzt einbindest)
 
das zauberwort heißt "classes". dann ist auh eine zweite css nicht nötig. mach es wie folgt:

1| geb der zu formatierenden tabelle ein weiteres attribut namens class und diesem einen namen:
Code:
<table class="alkohol">
  <tr>
    <td>
      alkohol
    </td>
  </tr>
</table>

2| nun formatierst du diese tabelle über die angegebene class in deinem css-file:
Code:
table.alkohol { 
background-color:   #416595;
color:              #ffffff;
font-family:        verdana,arial,helvetica,sans-serif;
font-size:          8pt;
padding:            5px;
}

das wars schon
 
Zuletzt bearbeitet:
danke ermal,

aber weisst du warum das nicht funktioniert?

table.tabellenx {
A:link {color: #FFFFFF;text-decoration:underline}
}
und dann

<table border="1" width="506" bordercolor="#333333" class="tabellenx">

thx
 
genau, und zwar so:

in der css:

A.halligalli:link {color: #FFFFFF;text-decoration:underline}

und dann in der html-datei:

<a href="#" class="halligalli">tolltolltoll</a>

tabellen bestimmte link-farben zuzuweisen geht so einfach glaub ich net. bist mit der variante hier wohl erstmal am besten dran....

s.
 
langsam ...

ist mir das peinlich, ich kriegs nicht hin:
ich hab keine css datei, ist die unbedingt notwendig?
bei mir siehts in der htm datei so aus:
<html>
<head>
<title></title>
A.tutscss:link {color: #FFFFFF;text-decoration:underline}

<style>
<!--
A:link {color: #999999;text-decoration:none}
A:visited {text-decoration: none; color: #999999}
A:hover {text-decoration: none; color: #66FF00}
.in { font-family: Arial, Helvetica; font-size: 9pt; font-weight: bold; line-height: normal}
-->
</style>
</head>

wenn noch jemand erbarmen habt, bitte klärt mich auf, thx
 
Re: langsam ...

hast die normalen link-definitionen doch acuh richtig eingebaut...ist doich nun nur noch logisch, das die erweiterte definition auh innerhalb der <STYLE> tags untergebracht werden muß, oder?


Code:
<style>
<!--
A.tutscss:link {
color: #FFFFFF;
text-decoration:underline;
}
A:link {
color: #999999;
text-decoration:none;
}
A:visited {
text-decoration: none; 
color: #999999;
}
A:hover {
text-decoration: none; 
color: #66FF00;
}
.in {
font-family: Arial, Helvetica; 
font-size: 9pt; 
font-weight: bold; 
line-height: normal;
}
-->
</style>
 
Status
Nicht offen für weitere Antworten.
Zurück