von Thomas Salvador.
Farben werden in HTML entweder mit ihrem Namen oder mit ihrem Wert beschrieben.
Netscape führte seinerzeit die websicheren Farben ein. Neben diesen Farbwerten, die einem bestimmten Schema folgen, definierte man noch 120 Werte und ordnete ihnen Namen zu.
Hintergrundfarbe dimgray | Schriftfarbe cornflowerblue | |||||
Detail | : | Hintergrund dimgray | Detail | : | Schrift cornflowerblue | |
Farbe | : | dimgray | Farbe | : | cornflowerblue | |
Farbwert | : | #696969 | Farbwert | : | #6495ed | |
HTML | : | dimgray | HTML | : | cornflowerblue | |
HTML (Wert) | : | #696969 | HTML (Wert) | : | #6495ed | |
CSS | : | dimgray | CSS | : | cornflowerblue | |
CSS (Wert) | : | #696969 | CSS (Wert) | : | #6495ed | |
CSS (kürzest) | : | #696969 | CSS (kürzest) | : | #6495ed | |
CSS (RGB) | : | rgb(105,105,105) | CSS (RGB) | : | rgb(100,149,237) | |
CSS (%RGB) | : | rgb(41%,41%,41%) | CSS (%RGB) | : | rgb(39%,58%,92%) |
Verlauf Hintergrundfarbe dimgray nach Schriftfarbe cornflowerblue | |||||||
#696969 | #686f7b | #67758e | #667ba1 | #6682b4 | #6588c7 | #648eda | #6495ed |
#696969 | #686f7b | #67758e | #667ba1 | #6682b4 | #6588c7 | #648eda | #6495ed |
Kombination von dimgray und cornflowerblue | |||||||
Aliquam dapibus, lorem sed bibendum consectetur, ligula enim dignissim ligula, a ultrices dolor augue ultrices magna. Cras id velit ante. Suspendisse augue erat, auctor ut ultricies non, facilisis sed neque. Cras vestibulum tristique erat, ac interdum justo cursus in. Lorem ipsum dolor sit amet, consectetur adipiscing elit. | Auf Hintergrund dimgray ist cornflowerblue ungeeignet, da weder der Helligkeitsunterschied noch der Farbunterschied ausreichend sind. Die Ähnlichkeit von cornflowerblue und dimgray ergibt sich zu 91.21%. Die Lesbarkeit dieser Kombination ergibt sich zu 8.79%. |
Hintergrundfarbe dimgray | Schriftfarbe cornflowerblue | ||||||
Verlauf nach Weiß | Verlauf nach Schwarz | Verlauf nach Weiß | Verlauf nach Schwarz | ||||
#696969 | #696969 | #696969 | #696969 | #6495ed | #6495ed | #6495ed | #6495ed |
#7e7e7e | #7e7e7e | #5a5a5a | #5a5a5a | #7aa4ef | #7aa4ef | #557fcb | #557fcb |
#939393 | #939393 | #4b4b4b | #4b4b4b | #90b3f2 | #90b3f2 | #476aa9 | #476aa9 |
#a9a9a9 | #a9a9a9 | #3c3c3c | #3c3c3c | #a6c2f4 | #a6c2f4 | #395587 | #395587 |
#bebebe | #bebebe | #2d2d2d | #2d2d2d | #bcd1f7 | #bcd1f7 | #2a3f65 | #2a3f65 |
#d4d4d4 | #d4d4d4 | #1e1e1e | #1e1e1e | #d2e0f9 | #d2e0f9 | #1c2a43 | #1c2a43 |
#e9e9e9 | #e9e9e9 | #0f0f0f | #0f0f0f | #e8effc | #e8effc | #0e1521 | #0e1521 |
#ffffff | #ffffff | #000000 | #000000 | #ffffff | #ffffff | #000000 | #000000 |
Die Textfarbe soll sich von Farbe dimgray auf Farbe cornflowerblue ändern, wenn man mit der Maus darauf zeigt. Wir bereiten zunächst eine Formatierung von <pre> in Farbe dimgray vor.
Als Beispiel legen wir die Textfarbe von <pre> auf Farbe dimgray fest und setzen die Schriftgröße auf 9px:
<style type="text/css"><!-- pre { font-size: 9px; color: dimgray; } //--> </style>Nun stellen wir ein, dass bei Berührung mit der Maus die Textfarbe auf cornflowerblue geändert wird.
<style type="text/css"><!-- pre:hover { color:cornflowerblue; } //--> </style>
Mehr zum Thema pre erfahren Sie in Blockorientierte Elemente in HTML. Möglichkeiten vom HTML-Befehl <pre>.