von Thomas Salvador.
Graustufen gehören zu den unbunten Farben und zeichnen sich dadurch aus, dass ihre Farbwerte für Rot, Grün und Blau gleich sind.
Graustufen enthalten natürlich alle 16 Graustufen und insbesondere die unbunten Grundfarben Schwarz und Weiß.
Um 256 Graustufen in HTML bzw. CSS zu erzeugen, wählen wir Farbwerte rr, gg und bb mit Werten von 0 bis 255 (d.h. hexadezimal 00 bis ff).
Hintergrundfarbe gray85 | Schriftfarbe gray2 | |||||
Detail | : | Hintergrund gray85 | Detail | : | Schrift gray2 | |
Farbe | : | gray85 | Farbe | : | gray2 | |
Farbwert | : | #555555 | Farbwert | : | #020202 | |
HTML | : | gray85 | HTML | : | gray2 | |
HTML (Wert) | : | #555555 | HTML (Wert) | : | #020202 | |
CSS | : | gray85 | CSS | : | gray2 | |
CSS (Wert) | : | #555555 | CSS (Wert) | : | #020202 | |
CSS (kürzest) | : | #555 | CSS (kürzest) | : | #020202 | |
CSS (RGB) | : | rgb(85,85,85) | CSS (RGB) | : | rgb(2,2,2) | |
CSS (%RGB) | : | rgb(33%,33%,33%) | CSS (%RGB) | : | rgb(0%,0%,0%) |
Verlauf Hintergrundfarbe gray85 nach Schriftfarbe gray2 | |||||||
#555555 | #494949 | #3d3d3d | #313131 | #252525 | #191919 | #0d0d0d | #020202 |
#555555 | #494949 | #3d3d3d | #313131 | #252525 | #191919 | #0d0d0d | #020202 |
Kombination von gray85 und gray2 | |||||||
Cras vestibulum tristique erat, ac interdum justo cursus in. Suspendisse augue erat, auctor ut ultricies non, facilisis sed neque. Cras id velit ante. Aliquam dapibus, lorem sed bibendum consectetur, ligula enim dignissim ligula, a ultrices dolor augue ultrices magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. | Die Ähnlichkeit der Farben gray2 und gray85 beträgt 86.75%. Die Lesbarkeit dieser Kombination liegt damit bei 13.25%. Auf Hintergrund gray85 ist gray2 ungeeignet. Die Helligkeit und Farben sind zu ähnlich. |
Hintergrundfarbe gray85 | Schriftfarbe gray2 | ||||||
Verlauf nach Weiß | Verlauf nach Schwarz | Verlauf nach Weiß | Verlauf nach Schwarz | ||||
#555555 | #555555 | #555555 | #555555 | #020202 | #020202 | #020202 | #020202 |
#6d6d6d | #6d6d6d | #484848 | #484848 | #262626 | #262626 | #010101 | #010101 |
#858585 | #858585 | #3c3c3c | #3c3c3c | #4a4a4a | #4a4a4a | #010101 | #010101 |
#9d9d9d | #9d9d9d | #303030 | #303030 | #6e6e6e | #6e6e6e | #010101 | #010101 |
#b6b6b6 | #b6b6b6 | #242424 | #242424 | #929292 | #929292 | #000000 | #000000 |
#cecece | #cecece | #181818 | #181818 | #b6b6b6 | #b6b6b6 | #000000 | #000000 |
#e6e6e6 | #e6e6e6 | #0c0c0c | #0c0c0c | #dadada | #dadada | #000000 | #000000 |
#ffffff | #ffffff | #000000 | #000000 | #ffffff | #ffffff | #000000 | #000000 |
Die Rahmenfarbe soll sich von Farbe gray85 auf Farbe gray2 ändern, wenn man mit der Maus darauf zeigt. Wir bereiten zunächst die Formatierung von <blockquote> in Farbe gray85 vor.
In diesem Beispiel umranden wir <blockquote> mit einem 3 Pixel dicken, herausstehenden Rahmen in Farbe gray85.
<style type="text/css"><!-- blockquote { border-style:outset; border-color:gray85; border-width:3px; } //--> </style>Nun fordern wir, dass bei Hover die Rahmenfarbe auf gray2 gesetzt wird.
<style type="text/css"><!-- blockquote:hover { border-color:gray2; } //--> </style>
Weiteres zu blockquote lesen Sie in Blockorientierte Elemente in HTML. Einzelheiten des hier genutzten Befehl blockquote sind in der HTML Referenz bei <blockquote> zusammengestellt.
Wir ändern Hher die Textfarbe von <label> auf Farbe gray2. Die Schriftart ändern wir auf monospace. Die Schriftgröße setzen wir auf 9px. Wir unterstreichen den Inhalt von <label> mit Hilfe eines gezahnten Rahmens mit 4 Pixel Dicke in Farbe gray85. Das geht in HTML nicht. Wir nutzen deshalb CSS zur Formatierung.
<style type="text/css"><!-- label { color:gray2; border-bottom-color:gray85; font-family:monospace; font-size:9px; border-bottom-style:ridge; border-bottom-width:4px; } //--> </style>
Die Idee ist, unterschiedliche Formatierungen für Inhalt und Unterstreichung zu haben.
Weiteres zu label können Sie in Formulare in HTML erfahren. Zur Beschreibung des Tag <label>.