HTML Blue Code

This page contains HTML code for coloring an element blue. You can have blue text, a blue background, or a blue border around an element.

Blue Text

This example uses inline styles to set the text color to blue (i.e. I use the style attribute against the HTML element).

In this case, I apply the styles against a <div> tag, but I could just have easily applied them against a <div> tag (for all text within that element) or even a <body> tag (for all text on the page).

Source CodeResult

Blue text

Here's the same thing, but this time using embedded styles.

Source CodeResult

Blue text

You could also place the CSS code into a external style sheet.

Blue Background Color

You can set the background color of an element to blue by using the CSS background-color property or the background shorthand property.

In this example, I've placed text inside a <div> tag, set its background color to blue, and set its text color to white.

Source CodeResult
White text, blue background.

Blue Border Color

In this example, I've added a blue border around a <div> element.

Source CodeResult
I have a blue border.

Blue Color Codes

The above examples use blue as the color value. I could just as easily used the hexadecimal or RGB color values and the result would've been the same.

Here are the various methods of specifying the color blue in HTML.

Source CodeResult

Blue text

Blue text (hexadecimal #0000ff)

Blue text (hexadecimal shorthand #00f)

Blue text (RGB value rgb(0,0,255))

Shades of Blue

Here are some different shades of blues & cyans that can be used instead of just plain old "blue".

Color Name Hex Code RGB Decimal Code RGB
Aqua 00FFFF 0,255,255
Cyan 00FFFF 0,255,255
LightCyan E0FFFF 224,255,255
PaleTurquoise AFEEEE 175,238,238
Aquamarine 7FFFD4 127,255,212
Turquoise 40E0D0 64,224,208
MediumTurquoise 48D1CC 72,209,204
DarkTurquoise 00CED1 0,206,209
CadetBlue 5F9EA0 95,158,160
SteelBlue 4682B4 70,130,180
LightSteelBlue B0C4DE 176,196,222
PowderBlue B0E0E6 176,224,230
LightBlue ADD8E6 173,216,230
SkyBlue 87CEEB 135,206,235
LightSkyBlue 87CEFA 135,206,250
DeepSkyBlue 00BFFF 0,191,255
DodgerBlue 1E90FF 30,144,255
CornflowerBlue 6495ED 100,149,237
MediumSlateBlue 7B68EE 123,104,238
RoyalBlue 4169E1 65,105,225
Blue 0000FF 0,0,255
MediumBlue 0000CD 0,0,205
DarkBlue 00008B 0,0,139
Navy 000080 0,0,128
MidnightBlue 191970 25,25,112

About was created in order to provide HTML tools, codes, tutorials, and other resources to help webmasters create and maintain their HTML documents. aims primarily at beginners, but may also be useful to web professionals.

About the HTML Codes

The HTML codes on this website are provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

My Related Sites

Here are some of my other sites: