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, einem bestimmten Schema folgenden, Farbwerten, definierte man noch 120 Werte und ordnete ihnen Namen zu. Zusammen mit den 17 Standard-HTML-Farben, die ebenfalls Namen haben, ergeben sich so 137 HTML Farbnamen.
Hintergrundfarbe olivedrab | Schriftfarbe burlywood | |||||
Detail | : | Hintergrund olivedrab | Detail | : | Schrift burlywood | |
Farbe | : | olivedrab | Farbe | : | burlywood | |
Farbwert | : | #6b8e23 | Farbwert | : | #deb887 | |
HTML | : | olivedrab | HTML | : | burlywood | |
HTML (Wert) | : | #6b8e23 | HTML (Wert) | : | #deb887 | |
CSS | : | olivedrab | CSS | : | burlywood | |
CSS (Wert) | : | #6b8e23 | CSS (Wert) | : | #deb887 | |
CSS (kürzest) | : | #6b8e23 | CSS (kürzest) | : | #deb887 | |
CSS (RGB) | : | rgb(107,142,35) | CSS (RGB) | : | rgb(222,184,135) | |
CSS (%RGB) | : | rgb(41%,55%,13%) | CSS (%RGB) | : | rgb(87%,72%,52%) |
Verlauf Hintergrundfarbe olivedrab nach Schriftfarbe burlywood | |||||||
#6b8e23 | #7b9431 | #8b9a3f | #9ca04d | #aca65c | #bdac6a | #cdb278 | #deb887 |
#6b8e23 | #7b9431 | #8b9a3f | #9ca04d | #aca65c | #bdac6a | #cdb278 | #deb887 |
Kombination von olivedrab und burlywood | |||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras id velit ante. Cras vestibulum tristique erat, ac interdum justo cursus in. Aliquam dapibus, lorem sed bibendum consectetur, ligula enim dignissim ligula, a ultrices dolor augue ultrices magna. Suspendisse augue erat, auctor ut ultricies non, facilisis sed neque. | Die Ähnlichkeit der Farben burlywood und olivedrab beträgt 90.24%. Die Lesbarkeit dieser Farbkombination liegt damit bei 9.76%. Auf Hintergrund olivedrab ist burlywood ungeeignet. Weder der Helligkeitsunterschied noch der Farbunterschied sind gross genug. |
Hintergrundfarbe olivedrab | Schriftfarbe burlywood | ||||||
Verlauf nach Weiß | Verlauf nach Schwarz | Verlauf nach Weiß | Verlauf nach Schwarz | ||||
#6b8e23 | #6b8e23 | #6b8e23 | #6b8e23 | #deb887 | #deb887 | #deb887 | #deb887 |
#809e42 | #809e42 | #5b791e | #5b791e | #e2c298 | #e2c298 | #be9d73 | #be9d73 |
#95ae61 | #95ae61 | #4c6519 | #4c6519 | #e7cca9 | #e7cca9 | #9e8360 | #9e8360 |
#aabe81 | #aabe81 | #3d5114 | #3d5114 | #ecd6ba | #ecd6ba | #7e694d | #7e694d |
#bfcea0 | #bfcea0 | #2d3c0f | #2d3c0f | #f0e0cb | #f0e0cb | #5f4e39 | #5f4e39 |
#d4dec0 | #d4dec0 | #1e280a | #1e280a | #f5eadc | #f5eadc | #3f3426 | #3f3426 |
#e9eedf | #e9eedf | #0f1405 | #0f1405 | #faf4ed | #faf4ed | #1f1a13 | #1f1a13 |
#ffffff | #ffffff | #000000 | #000000 | #ffffff | #ffffff | #000000 | #000000 |
Mit HTML-Tag <h2> erzeugen Sie eine Überschrift. Diese kann man farblich gestalten und hervorheben.
In diesem Beispiel ändern wir die Textfarbe von <h2> auf Farbe burlywood und lassen die Hintergrundfarbe unverändert. Die Schriftart setzen wir auf courier new. Die Schriftgröße verringern wir auf 83%. Wir unterstreichen den Inhalt von <h2> mit Hilfe eines doppelten Rahmens mit 4 Pixel Dicke in Farbe olivedrab. Dies ist mit HTML kaum möglich. Wir verwenden deshalb CSS.
<style type="text/css"><!-- h2 { color: burlywood; font-size: 83%; font-family: courier new; border-bottom-style: double; border-bottom-color: olivedrab; border-bottom-width: 4px; } //--> </style>
Die Idee ist, unterschiedliche Formatierungen für Inhalt und Unterstreichung zu haben.
Weiteres zum Thema h2 können Sie in Grundlegende Gestaltungselemente in HTML finden. Einzelheiten des hier verwendeten Befehl <h2>.
Mit Befehl <div> erzeugen Sie einen Universalkontainer. Diesen kann man hervorheben und farblich gestalten.
Die Textfarbe soll sich von Farbe olivedrab auf Farbe burlywood ändern, wenn man mit der Maus auf <div> zeigt. Wir bereiten zunächst die Formatierung von <div> in Farbe olivedrab vor.
Z.B. legen wir Farbe olivedrab als Textfarbe von <div> fest.
<style type="text/css"><!-- div { color:olivedrab; } //--> </style>Jetzt stellen wir ein, dass bei Mausberührung die Textfarbe auf burlywood geändert wird.
<style type="text/css"><!-- div: hover { color: burlywood; } //--> </style>
Beschreibung des HTML-Tag <div>.