HTML Color Names

HTML Color Names are predefined color keywords supported by all modern web browsers. These color names are used in HTML and CSS to apply colors to webpage elements such as text, backgrounds, borders, buttons, tables, links, forms, and layouts.

Instead of using complex color formats like HEX codes, RGB values, or HSL values, developers can directly use readable color names such as red, blue, green, orange, and tomato.

HTML currently supports more than 140 standard color names officially recognized by web browsers.

HTML color names are beginner-friendly, easy to remember, and widely used in modern web development for quick styling and rapid UI design.

Each color name is internally mapped to a unique HEX color value. For example:

  • Red represents #FF0000
  • Blue represents #0000FF
  • Green represents #008000

These color names can be used directly inside HTML attributes or CSS properties.

HTML color names are commonly used with the style attribute in HTML elements.

Syntax

<element style="property:colorname;">

HTML Color Names Example

<h1 style="color:blue;">Blue Heading</h1>

<p style="background-color:yellow;">
Yellow Background
</p>

<div style="border:2px solid red;">
Red Border
</div>

In the above example:

  • The heading text becomes blue
  • The paragraph background becomes yellow
  • The border becomes red

HTML Supported Color Names

Below are some popular HTML color names supported by all major browsers.

Color NameHEX CodePreview
AliceBlue#F0F8FFAliceBlue
AntiqueWhite#FAEBD7AntiqueWhite
Aqua#00FFFFAqua
Aquamarine#7FFFD4Aquamarine
Azure#F0FFFFAzure
Beige#F5F5DCBeige
Bisque#FFE4C4Bisque
Black#000000Black
Blue#0000FFBlue
Brown#A52A2ABrown
Coral#FF7F50Coral
Crimson#DC143CCrimson
Cyan#00FFFFCyan
Gold#FFD700Gold
Gray#808080Gray
Green#008000Green
Indigo#4B0082Indigo
Khaki#F0E68CKhaki
Lavender#E6E6FALavender
Lime#00FF00Lime
Magenta#FF00FFMagenta
Maroon#800000Maroon
Navy#000080Navy
Olive#808000Olive
Orange#FFA500Orange
Pink#FFC0CBPink
Purple#800080Purple
Red#FF0000Red
Salmon#FA8072Salmon
Silver#C0C0C0Silver
SkyBlue#87CEEBSkyBlue
Teal#008080Teal
Tomato#FF6347Tomato
Violet#EE82EEViolet
White#FFFFFFWhite
Yellow#FFFF00Yellow

Complete HTML Color Names Example

<!DOCTYPE html>
<html>
<head>
<title>HTML Color Names</title>
</head>

<body>

<h1 style="color:tomato;">
Tomato Color Heading
</h1>

<p style="background-color:lightblue;">
LightBlue Background
</p>

<div style="border:2px solid green;">
Green Border Example
</div>

</body>
</html>

Using HTML Color Names in CSS

HTML color names are also heavily used in CSS stylesheets.

Example

<style>

body {
  background-color: whitesmoke;
}

h1 {
  color: darkblue;
}

p {
  color: crimson;
}

</style>

This method is commonly used in professional website development and UI design.

Leave a Comment