Introduction to Color Name in HTML

Color Name in HTML

Introduction to Color Name in HTML

Color Name in HTML plays a very important role in the web and application designing process. It helps to changes the look and feel of our website or application as well as it makes our application more attractive and interactive. There are various ways to define Color Name in HTML into the HTML coding format. one can use additional CSS properties to use it more effectively. We are able to use HTML color name at the page level by including it into the body part also able to set to individual color to the specific element. Color Name in HTML is purposely used for text color, background color, border color, shadows, gradients and many more.

Syntax

  • There are various ways we can use HTML colors. Letโ€™s see one by one.
  • The very basic use of HTML color is to apply it to the text. simply use as text color to showing text in different HTML colors.

1. Text Color Syntax

color : color_name;

Letโ€™s see how this syntax will work,

<h4 style=โ€color:blue;โ€>Welcome to EDUBCA<h4>

In the above example, it will show text Welcome to EDUBCA in a blue color like:

Color Name in HTML 1
  • With the help of HTML colors, itโ€™s also possible to add them as a background color.

2. Background-color Syntax

background-color:color_name;

Letโ€™s see how this syntax will work,

<p style="background-color:light-green;">

The category houses all the Design information spreading across numerous subcategories in the Design course.

</p>

color name in html
  • Itโ€™s also possible to add a colored border around any text or element by using HTML color by using the following syntax:

3. Border color Syntax: border

value color_name;

Letโ€™s see how this syntax will work,

<h4 style="border: 4px solid DodgerBlue;"> EDUCBA free certification course </h4>

color name in html

Types of the Color Name in HTML

There are different ways to define the color names in HTML. Itโ€™s difficult to remember a different name in different colors. So itโ€™s to be decided to give some values to different colors. Letโ€™s see one by one.

Types of the Color Name in HTML

1. RGB Value

  • It is one of the ways to define HTML color names in the combination of Red, Green and Blue color format values. Which is used to define color intensity between the number 0 to 255?
  • If we want to define a black color using an RGB combination, it will like RGB(0,0,0). Here all parameters of color will set to 0. So it will display a black color.
  • Like another RGB(0,0,255) will display color blue, due to 255 is set as the highest value to blue and the other is 0.
  • If we are going to 3 equal values of RGB, then it will generate shades of a gray color.

Example: RGB (0,0,0) for darkest color where RGB(255,255,255) for lightest color.

2. HEX Value

  • Itโ€™s one of the most commonly used formats of a color name in HTML in which color name will be defined in the format of a hexadecimal value.
  • #rrggbb format includes values from RR for red, gg for green and bb for blue are placed in between 00 toff hexadecimal value.
  • Letโ€™s consider one example defining color #00ff00 . These values will be generated color green because of green containing the highest value(ff) where the other is set to 00.

3. HSL Value

  • Another format to define HTML color in the form of Hue, Saturation, Lightness.
  • Now we will see all the terms one by one. Hue is defined as the degree of color between 0 to 360 . 0 for red, 120 for green and 240 for blue.
  • Saturation defines the value of color into the percentage, in which 0% says the shade of grey where 100% for full color.
  • Lightness is also working as the percentage, which defines 0% for black, 50% is for neither light or dark where 100% is for white.

4. RGBA value

  • This type of HTML color defines an extension for RGB color, including alpha value where alpha is used to define the opacity of the color.
  • Alpha value comes in between 0.0 {fully transparent} to 1.0 {not transparent at all}
  • Example is rgba(255,99,71,0)

5. HSLA Value

  • It works the same as HSL colors value additional alpha value for defining the opacity of the color.
  • hsla(8,100%,80%,0) for fully transparent color.
  • hsla(8,100%,80%,0.9) for not that much transparent color.

Using HTML Color Names

Implementing colors on your webpage is easy and can be done both inline and via a separate CSS Stylesheet. Popular Course in this categoryHTML Training (12 Courses, 19+ Projects, 4 Quizzes)12 Online Courses | 19 Hands-on Projects | 89+ Hours | Verifiable Certificate of Completion | Lifetime Access | | 4 Quizzes with Solutions
4.5 (6,502 ratings)Course Price
โ‚น6999 โ‚น41999
View Course


Related CoursesBootstrap Training (2 Courses, 6+ Projects)XML Training (5 Courses, 6+ Projects)CSS Training (9 Courses, 9+ Projects)

When you are going to be using the same HTML Color Names on a page multiple times, it is a better idea to use CSS Sheet to define and set colors. Conversely, if you only have to use color once or twice, using the inline method is considered better.

1. Using HTML Color Inline

<body>
<h3 style="color: Brown">Brown H3 Heading</h3>
<p style="color: Gainsboro">Gainsboro colored paragraph text</p>
</body>

2. Implementing in CSS

h1 { color: Brown; }
p { color: Gainsboro; }

Different HTML Color Codes

Colors can be denoted by using their hex value or their name. HTML has support for the most common colors; in this article, I will share with you 140 names and hex values of these colors. One thing to keep in mind is that you donโ€™t have to limit yourself to these colors; you can use any color picker tool to find the Hex value of any color you want and use it on your web page.

Now that you know what HTML Color Names are and how you can use them in your pages, here is a list of Color names with appropriate color codes:

1. Grey and Black HTML Color Names

Grey and Black colors are, in most cases, perfect for the text color of the page as against a white background; these colors have the best readability. One interesting thing to keep in mind is that modern phones with OLED displays done need any battery power to display Black color; if your audience is going to be on mobile, it is a wise idea to use Black as a background color and white or other light colors as the foreground color.

CodeColor
#000000Black
#0C090ANight
#2C3539Gunmetal
#2B1B17Midnight
#34282CCharcoal
#25383CDark Slate Grey
#3B3131Oil
#413839Black Cat
#3D3C3AIridium
#463E3FBlack Eel
#4C4646Black Cow
#504A4BGray Wolf
#565051Vampire Gray
#5C5858Gray Dolphin
#625D5DCarbon Gray
#666362Ash Gray
#6D6968Cloudy Gray
#726E6DSmokey Gray
#736F6EGray
#837E7CGranite
#848482Battleship Gray
#B6B6B4Gray Cloud
#D1D0CEGray Goose
#E5E4E2Platinum
#BCC6CCMetallic Silver
#98AFC7Blue Gray
#6D7B8DLight Slate Gray
#657383Slate Gray
#616D7EJet Gray

2. Blue HTML Color Names

Blue underlined text is considered as a Link as it is the default link style for most web browsers, you should avoid using blue for all text on a page as visitors can mistake it for hyperlinks.

#646D7EMist Blue
#566D7EMarble Blue
#737CA1Slate Blue
#4863A0Steel Blue
#2B547EBlue Jay
#2B3856Dark Slate Blue
#151B54Midnight Blue
#000080Navy Blue
#342D7EBlue Whale
#15317ELapis Blue
#151B8DDenim Dark Blue
#0000A0Earth Blue
#0020C2Cobalt Blue
#0041C2Blueberry Blue
#2554C7Sapphire Blue
#1569C7Blue Eyes
#2B60DERoyal Blue
#1F45FCBlue Orchid
#6960ECBlue Lotus
#736AFFLight Slate Blue
#357EC7Windows Blue
#368BC1Glacial Blue Ice
#488AC7Silk Blue
#3090C7Blue Ivy
#659EC7Blue Koi
#87AFC7Columbia Blue
#95B9C7Baby Blue
#728FCELight Steel Blue
#2B65ECOcean Blue
#306EFFBlue Ribbon
#157DECBlue Dress
#1589FFDodger Blue
#6495EDCornflower Blue
#6698FFSky Blue
#38ACECButterfly Blue
#56A5ECIceberg
#5CB3FFCrystal Blue
#3BB9FFDeep Sky Blue
#79BAECDenim Blue
#82CAFALight Sky Blue
#82CAFFDay Sky Blue
#A0CFECJeans Blue
#B7CEECBlue Angel
#B4CFECPastel Blue
#C2DFFFSea Blue
#C6DEFFPowder Blue
#AFDCECCoral Blue
#ADDFFFLight Blue
#BDEDFFRobin Egg Blue
#CFECECPale Blue Lily
#E0FFFFLight Cyan
#EBF4FAWater
#F0F8FFAliceBlue
#F0FFFFAzure
#CCFFFFLight Slate
#93FFE8Light Aquamarine
#9AFEFFElectric Blue
#7FFFD4Aquamarine
#00FFFFCyan or Aqua
#7DFDFETron Blue
#57FEFFBlue Zircon
#8EEBECBlue Lagoon
#50EBECCeleste
#4EE2ECBlue Diamond
#81D8D0Tiffany Blue
#92C7C7Cyan Opaque
#77BFC7Blue Hosta
#78C7C7Northern Lights Blue
#48CCCDMedium Turquoise
#43C6DBTurquoise
#46C7C7Jellyfish
#7BCCB5Blue green

3. Green HTML Colors

On sites related to nature, money, environment etc, Green can be a good choice of color to use as a background.

#43BFC7Macaw Blue Green
#3EA99FLight Sea Green
#3B9C9CDark Turquoise
#438D80Sea Turtle Green
#348781Medium Aquamarine
#307D7EGreenish Blue
#5E7D7EGrayish Turquoise
#4C787EBeetle Green
#008080Teal
#4E8975Sea Green
#78866BCamouflage Green
#848b79Sage Green
#617C58Hazel Green
#728C00Venom Green
#667C26Fern Green
#254117Dark Forest Green
#306754Medium Sea Green
#347235Medium Forest Green
#437C17Seaweed Green
#387C44Pine Green
#347C2CJungle Green
#347C17Shamrock Green
#348017Medium Spring Green
#4E9258Forest Green
#6AA121Green Onion
#4AA02CSpring Green
#41A317Lime Green
#3EA055Clover Green
#6CBB3CGreen Snake
#6CC417Alien Green
#4CC417Green Apple
#52D017Yellow Green
#4CC552Kelly Green
#54C571Zombie Green
#99C68EFrog Green
#89C35CGreen Peas
#85BB65Dollar Bill Green
#8BB381Dark Sea Green
#9CB071Iguana Green
#B2C248Avocado Green
#9DC209Pistachio Green
#A1C935Salad Green
#7FE817Hummingbird Green
#59E817Nebula Green
#57E964Stoplight Go Green
#64E986Algae Green
#5EFB6EJade Green
#00FF00Green
#5FFB17Emerald Green
#87F717Lawn Green
#8AFB17Chartreuse
#6AFB92Dragon Green
#98FF98Mint green
#B5EAAAGreen Thumb
#C3FDB8Light Jade
#CCFB5DTea Green
#B1FB17Green Yellow
#BCE954Slime Green
#EDDA74Goldenrod
#EDE275Harvest Gold
#FFE87CSun Yellow

4. Yellow HTML Color Names

Yellow can be used to set a non-serious mood, show creativity and optimism in a page. Keep in mind that yellow works better as background then a text color.

#FFFF00Yellow
#FFF380Corn Yellow
#FFFFC2Parchment
#FFFFCCCream
#FFF8C6Lemon Chiffon
#FFF8DCCornsilk
#F5F5DCBeige
#FBF6D9Blonde
#FAEBD7AntiqueWhite
#F7E7CEChampagne
#FFEBCDBlanchedAlmond
#F3E5ABVanilla
#ECE5B6Tan Brown
#FFE5B4Peach
#FFDB58Mustard
#FFD801Rubber Ducky Yellow
#FDD017Bright Gold
#EAC117Golden brown
#F2BB66Macaroni and Cheese
#FBB917Saffron
#FBB117Beer
#FFA62FCantaloupe
#E9AB17Bee Yellow

5. Brown HTML Colors

Brown background can make it difficult to read the white or black text, you can resort to user other colors that have good contrast against your shade of brown.

#E2A76FBrown Sugar
#DEB887BurlyWood
#FFCBA4Deep Peach
#C9BE62Ginger Brown
#E8A317School Bus Yellow
#EE9A4DSandy Brown
#C8B560Fall Leaf Brown
#D4A017Orange Gold
#C2B280Sand
#C7A317Cookie Brown
#C68E17Caramel
#B5A642Brass
#ADA96EKhaki
#C19A6BCamel brown
#CD7F32Bronze
#C88141Tiger Orange
#C58917Cinnamon
#AF9B60Bullet Shell
#AF7817Dark Goldenrod
#B87333Copper
#966F33Wood
#806517Oak Brown
#827839Moccasin
#827B60Army Brown
#786D5FSandstone
#493D26Mocha
#483C32Taupe
#6F4E37Coffee
#835C3BBrown Bear
#7F5217Red Dirt
#7F462CSepia

6. Orange HTML Colors

Orange works great to highlight a point the when color used as a background and it can evoke feeling of enthusiasm and warmth without being too tacky.6. Orange HTML Colors

#C47451Orange Salmon
#C36241Rust
#C35817Red Fox
#C85A17Chocolate
#CC6600Sedona
#E56717Papaya Orange
#E66C2CHalloween Orange
#F87217Pumpkin Orange
#F87431Construction Cone Orange
#E67451Sunrise Orange
#FF8040Mango Orange
#F88017Dark Orange
#FF7F50Coral
#F88158Basket Ball Orange
#F9966BLight Salmon
#E78A61Tangerine
#E18B6BDark Salmon
#E77471Light Coral
#F75D59Bean Red
#E55451Valentine Red
#E55B3CShocking Orange

7. Red HTML Color Codes

For some browsers, Red underlined text is used as visited links, you should avoid using it to not confuse the visitors.

#FF0000Red
#FF2400Scarlet
#F62217Ruby Red
#F70D1AFerrari Red
#F62817Fire Engine Red
#E42217Lava Red
#E41B17Love Red
#DC381FGrapefruit
#C34A2CChestnut Red
#C24641Cherry Red
#C04000Mahogany
#C11B17Chilli Pepper
#9F000FCranberry
#990012Red Wine
#8C001ABurgundy
#954535Chestnut
#7E3517Blood Red
#8A4117Sienna
#7E3817Sangria
#800517Firebrick
#810541Maroon
#7D0541Plum Pie
#7E354DVelvet Maroon
#7D0552Plum Velvet
#7F4E52Rosy Finch
#7F5A58Puce
#7F525DDull Purple
#B38481Rosy Brown
#C5908EKhaki Rose

8. Pink HTML Color Codes

According to color science, Pink and its shades can be used if you want the visitor to have a feeling of confidence, sophistication and warmness in their subconscious.

#C48189Pink Bow
#C48793Lipstick Pink
#E8ADAARose
#ECC5C0Rose Gold
#EDC9AFDesert Sand
#FDD7E4Pig Pink
#FCDFFFCotton Candy
#FFDFDDPink Bubble Gum
#FBBBB9Misty Rose
#FAAFBEPink
#FAAFBALight Pink
#F9A7B0Flamingo Pink
#E7A1B0Pink Rose
#E799A3Pink Daisy
#E38AAECadillac Pink
#F778A1Carnation Pink
#E56E94Blush Red
#F660ABHot Pink
#FC6C85Watermelon Pink
#F6358AViolet Red
#F52887Deep Pink
#E45E9DPink Cupcake
#E4287CPink Lemonade
#F535AANeon Pink
#FF00FFMagenta
#E3319DDimorphotheca Magenta
#F433FFBright Neon Pink
#D16587Pale Violet Red
#C25A7CTulip Pink
#CA226BMedium Violet Red
#C12869Rogue Pink
#C12267Burnt Pink
#C25283Bashful Pink
#C12283Dark Carnation Pink
#B93B8FPlum

9. Purple and White HTML Color Codes

Using White Text color against White background will make it unreadable by the users and aside from not being user friendly, you could get an SEO penalty for your site thus, always use white and other light colors against dark backgrounds.

#7E587EViola Purple
#571B7EPurple Iris
#583759Plum Purple
#4B0082Indigo
#461B7EPurple Monster
#4E387EPurple Haze
#614051Eggplant
#5E5A80Grape
#6A287EPurple Jam
#7D1B7EDark Orchid
#A74AC7Purple Flower
#B048B5Medium Orchid
#6C2DC7Purple Amethyst
#842DCEDark Violet
#8D38C9Violet
#7A5DC7Purple Sage Bush
#7F38ECLovely Purple
#8E35EFPurple
#893BFFAztech Purple
#8467D7Medium Purple
#A23BECJasmine Purple
#B041FFPurple Daffodil
#C45AECTyrian Purple
#9172ECCrocus Purple
#9E7BFFPurple Mimosa
#D462FFHeliotrope Purple
#E238ECCrimson
#C38EC7Purple Dragon
#C8A2C8Lilac
#E6A9ECBlush Pink
#E0B0FFMauve
#C6AEC7Wisteria Purple
#F9B7FFBlossom Pink
#D2B9D3Thistle
#E9CFECPeriwinkle
#EBDDE2Lavender Pinocchio
#E3E4FALavender blue
#FDEEF4Pearl
#FFF5EESeaShell
#FEFCFFMilk White
#FFFFFFWhite

Some most used HTML Color Codes

These are some of the popular colors used on the web; I have put them in a separate table to quickly find these.

Red#FF0000White#FFFFFF
Cyan#00FFFFSilver#C0C0C0
Blue#0000FFGray or Grey#808080
DarkBlue#0000A0Black#000000
LightBlue#ADD8E6Orange#FFA500
Purple#800080Brown#A52A2A
Yellow#FFFF00Maroon#800000
Lime#00FF00Green#008000
Magenta#FF00FFOlive#808000

Examples of Color Name in HTML

Let us see how color name in HTML is used with the help of some examples mentioned below:

Example #1

Let us consider a general example showing how example color name in HTML is going to be used:

HTML code:

<!DOCTYPE html>
<html>
<body>
<h1 style="color:Violet;">About Life.....</h1>
<h4 >Creativity Is Intelligence Having Fun </h4>
<p style="background-color: #00FFFF; color:blue">

You Learn More From Failure Than From Success. Donโ€™t Let It Stop You. Failure Builds Character. If You Are Working On Something That You Really Care About, You Donโ€™t Have To Be Pushed. The Vision Pulls You

</p>
</body>
</html>

Output:

html code

Example #2

Now we are taking another example which will define all types of HTML color as follows:

HTML code:

<!DOCTYPE html>
<html>
<body>
<h1 style="color:rgb(255, 0, 0);">RGB defines Red color</h1>
<h1 style="color:rgb(60, 60, 60);">RGB same values define Gray shade</h1>
<h1 style="background-color:#ffa500;">New color using Hex Value</h1>
<h1 style="background-color:#787878;">Shade of Gray</h1>
<h1 style="background-color:hsl(50, 100%, 50%);">hsl color shade</h1>
<h1 style="background-color:rgba(255, 99, 71, 0.4);">rgba color shade</h1>
<h1 style="color:hsla(9, 100%, 80%, 0.5);">hsla color shade</h1>
</body>
</html>

Output:

html code

In the above example, we are able to see the use of different HTML color types and how they are named in HTML.

Example #3

One more use of HTML color is to define a border to the element, which is as follows:

In Example, Here, we can add a border to your code body, changing the background and text colour.

HTML code:

<p style="border: 2px solid #A52A2A; background-color:#ffa500;color:#FFF8DC">Self-actualizing theory talks of intrinsic rewards inherent in the task performance such as job satisfaction, feeling of achievement, etc.</p>

Output:

 html code

Conclusion

We came across that HTML colors are defined with different names, percentage value, Hex value, alpha value and many more. Color name in HTML is used to do color for text, for background, for a border, for gradations. Different types define HTML color name as RGB, hex, hsl, rgba, hsla.

Recommended Articles

This is a guide to Color Name in HTML. Here we discuss the introduction, Types of the Color Name in HTML, and examples, Syntax, and HTML codes. You can also go through our other suggested articles to learn more โ€“

  1. HTML Style Attribute
  2. HTML Table Tags
  3. Image Link in HTML
  4. Create Tables in HTML

Leave a Comment

Your email address will not be published. Required fields are marked *