Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.CSS Colors


Red

Pink

Purple

Deep Purple

Indigo

Blue

Light Blue

Cyan

Aqua

Teal

Green

Light Green

Lime

Sand

Khaki

Yellow

Amber

Orange

Deep Orange

Blue Gray

Brown

Light Gray

Gray

Dark Gray

Pale Red

Pale Yellow

Pale Green

Pale-Blue

The default color scheme used in W3.CSS is inspired by Material Design Colors (colors used in marketing, road signs, and sticky notes).


Coloring HTML Elements

The w3-color and w3-text-color classes can be used to color any HTML element:

Containers:

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Buttons:

Text:

Red Purple Blue Green Orange

Borders:

Red

Green

Blue

Yellow

Gray

Black

Tables:

Name Points
Jill Smith 50
Eve Jackson 94
Adam Johnson 67

Cards:

A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads, to have seating for one to eight people, to typically have four wheels. (Wikipedia)



Background Colors

The w3-color classes set the background color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.


London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.


London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

<div class="w3-red">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom,
  with a metropolitan area of over 9 million inhabitants.</p>
</div>

<div class="w3-yellow">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom,
  with a metropolitan area of over 9 million inhabitants.</p>
</div>

<div class="w3-gray">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom,
  with a metropolitan area of over 9 million inhabitants.</p>
</div>
Try It Yourself »

The colors gray and grey are interchangeable in all W3.CSS classes.


Text Colors

The w3-text-color classes set the text color of any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

<div class="w3-text-red">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom,
  with a metropolitan area of over 9 million inhabitants.</p>
</div>

Try It Yourself »


Hover Colors

The w3-hover-color classes define the background hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

<div class="w3-container w3-orange w3-hover-red">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.</p>
</div>
Try It Yourself »

The w3-hover-text-color classes define the text hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

<div class="w3-container w3-orange w3-hover-text-white">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.</p>
</div>
Try It Yourself »

Color libraries

In addition to standard W3.CSS colors, W3.CSS can also use colors from a lot of different color libraries:

Windows Colors:

Lime
Green
Olive
Emerald
Teal
Steel
Cyan
Blue
Indigo
Cobalt
Violet
Mauve
Pink
Magenta
Red
Orange
Amber
Yellow
Brown
Taupe
Sienna
Crimson

Click here to Learn more about Windows colors


Fashion Colors:

Flame
Greenery
Marina
Primrose
Yellow
Neutral Gray
Shaded
Spruce
Navy
Peony
Tawny
Port

Click here to Learn more about fashion colors


Highway Colors:

Red
Green
Blue
Yellow

Click here to Learn more about color libraries

You will learn a lot more about colors in later chapters of this tutorial.


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.