von Thomas Salvador.
Farben werden in HTML entweder mit ihrem Namen oder mit ihrem Wert beschrieben.
HTML verfügt seit jeher über 17 Standard Farbnamen.
Sie entstehen dadurch, dass die 8 Grundfarben jeweils maximal und zu 50% enthalten sind.
Zu diesen 16 Farben kommt mit grey eine alternative Schreibweise für gray.
Hintergrundfarbe white | Schriftfarbwert #808080 | |||||
Detail | : | Hintergrund white | Detail | : | Schrift #808080 | |
Farbe | : | white | Farbwert | : | #808080 | |
Farbwert | : | #ffffff | Farbe | : | gray | |
HTML | : | white | HTML | : | #808080 | |
HTML (Wert) | : | #ffffff | HTML (Wert) | : | #808080 | |
CSS | : | white | CSS | : | #808080 | |
CSS (Wert) | : | #ffffff | CSS (Wert) | : | #808080 | |
CSS (kürzest) | : | #fff | CSS (kürzest) | : | #808080 | |
CSS (RGB) | : | rgb(255,255,255) | CSS (RGB) | : | rgb(128,128,128) | |
CSS (%RGB) | : | rgb(100%,100%,100%) | CSS (%RGB) | : | rgb(50%,50%,50%) |
Verlauf Hintergrundfarbe white nach Schriftfarbwert #808080 | |||||||
#ffffff | #ececec | #dadada | #c8c8c8 | #b6b6b6 | #a4a4a4 | #929292 | #808080 |
#ffffff | #ececec | #dadada | #c8c8c8 | #b6b6b6 | #a4a4a4 | #929292 | #808080 |
Kombination von white und #808080 | |||||||
Cras vestibulum tristique erat, ac interdum justo cursus in. Suspendisse augue erat, auctor ut ultricies non, facilisis sed neque. Aliquam dapibus, lorem sed bibendum consectetur, ligula enim dignissim ligula, a ultrices dolor augue ultrices magna. Cras id velit ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. | #808080 eignet sich nicht als Schriftfarbe auf Hintergrund white. Zwar ist der Helligkeitsunterschied in Ordnung, doch die Farben selbst sind zu ähnlich. Die Ähnlichkeit von #808080 und white beträgt 81.19%. Die Lesbarkeit dieser Kombination liegt damit bei 18.81%. |
Hintergrundfarbe white | Schriftfarbwert #808080 | ||||||
Verlauf nach Weiß | Verlauf nach Schwarz | Verlauf nach Weiß | Verlauf nach Schwarz | ||||
#ffffff | #ffffff | #ffffff | #ffffff | #808080 | #808080 | #808080 | #808080 |
#ffffff | #ffffff | #dadada | #dadada | #929292 | #929292 | #6d6d6d | #6d6d6d |
#ffffff | #ffffff | #b6b6b6 | #b6b6b6 | #a4a4a4 | #a4a4a4 | #5b5b5b | #5b5b5b |
#ffffff | #ffffff | #919191 | #919191 | #b6b6b6 | #b6b6b6 | #494949 | #494949 |
#ffffff | #ffffff | #6d6d6d | #6d6d6d | #c8c8c8 | #c8c8c8 | #363636 | #363636 |
#ffffff | #ffffff | #484848 | #484848 | #dadada | #dadada | #242424 | #242424 |
#ffffff | #ffffff | #242424 | #242424 | #ececec | #ececec | #121212 | #121212 |
#ffffff | #ffffff | #000000 | #000000 | #ffffff | #ffffff | #000000 | #000000 |
Werden zwei Farben abweselnd als Hintergrundfarbe genommen, spricht man von einem Zebra-Effekt. Er unterstützt das Auge, etwa die Zeile oder Spalte nicht zu verlieren. Wir definieren zwei Klassen .yang und .ying für <th> mit unterschiedlichen Hintergrundfarben Farbe white und Farbwert #808080.
<style type="text/css"><!-- th.yang { background-color:white; } th.ying { background-color:#808080; } //--> </style>
Diese Klassen werden dann abwechselnd verwendet.
<table> <tr><td class="yang">LA/A</td><td class="ying">LB/A</td><td class="yang">LC/A</td></tr> <tr><td class="yang">LA/B</td><td class="ying">LB/B</td><td class="yang">LC/B</td></tr> <tr><td class="yang">LA/C</td><td class="ying">LB/C</td><td class="yang">LC/C</td></tr> </table>
Weiteres zum Thema lesen Sie in Tabellen in HTML. Der hier gezeigte Befehl th ist in der HTML Referenz bei <th> ausführlich beschrieben.
Für dieses Beispiel umranden wir <textarea> mit einem gefurchten, 4 Pixel dicken Rahmen in Farbwert #808080 . Die Hintergrundfarbe für <textarea> färben wir mit Farbe white. In HTML geht dies nicht. Wir verwenden daher CSS zur Formatierung.
<style type="text/css"><!-- textarea { border-width:4px; border-color:#808080; background-color:white; border-style:groove; } //--> </style>
Weiteres zu textarea können Sie in Formulare in HTML nachsehen. Der hier verwendete Tag textarea ist in der HTML Referenz bei <textarea> gezeigt.
Hintergrund | Farbwert | Farbe | und | Schrift | Farbwert | Farbkombination |
---|---|---|---|---|---|---|
aqua | #00ffff | + | aqua | #00ffff | aqua / white | |
black | #000000 | + | black | #000000 | black / white | |
blue | #0000ff | + | blue | #0000ff | blue / white | |
fuchsia | #ff00ff | + | fuchsia | #ff00ff | fuchsia / white | |
gray | #808080 | + | gray | #808080 | gray / white | |
grey | #808080 | + | grey | #808080 | grey / white | |
green | #008000 | + | green | #008000 | green / white | |
lime | #00ff00 | + | lime | #00ff00 | lime / white | |
maroon | #800000 | + | maroon | #800000 | maroon / white | |
navy | #000080 | + | navy | #000080 | navy / white | |
olive | #808000 | + | olive | #808000 | olive / white | |
purple | #800080 | + | purple | #800080 | purple / white | |
red | #ff0000 | + | red | #ff0000 | red / white | |
silver | #c0c0c0 | + | silver | #c0c0c0 | silver / white | |
teal | #008080 | + | teal | #008080 | teal / white | |
white | #ffffff | + | white | #ffffff | white / white | |
yellow | #ffff00 | + | yellow | #ffff00 | yellow / white |