create account

HTML 5 Tutorial #12 - HTML Colors by cj23

View this thread on: hive.blogpeakd.comecency.com
· @cj23 ·
$11.05
HTML 5 Tutorial #12 - HTML Colors
# HTML Colors 
We can change the color of an element using predefined color names or RGB, HEX, HSL, RGBA, HSLA values.

## Color Names 
A color of an element can be changed using the color name. 

![Example.png](https://steemitimages.com/DQmSeqka7ChoKqsaBRHghteSSoPv25TuFm51bmkGBPWE7b2/Example.png)

## Background Color 
If it's the background color you want to change, use the background-color property. 

![Example.png](https://steemitimages.com/DQmY6NGsvmCdLJyCiU247CndjJs2cAG9GqwaZvWUP79qaui/Example.png)

## Text Color
If it's the text color you want to change, use the color property. 

![Example.png](https://steemitimages.com/DQmeJ2rueNzEDWNwaqzanGHiwCJbKxxXFcSdaTAvB8W9L35/Example.png)

## Border Color 
You can change the borders color using the border property. 

![Example.png](https://steemitimages.com/DQmWKRefUH9LSZCsZj3gFJWZ6YG1MordfDHUReHNezDAyu9/Example.png)

## Color Values
To have more choices of colors, we can use RGB values, HEX values, HSL values, RGBA values, and HSLA values.

![Example.png](https://steemitimages.com/DQmNSXASUMMuWMKbuNVJjeh4n7kKvNpyxDEwsxGwANnuQ4Y/Example.png)

## RGB Value
RGB value can be specified using this formula: rgb(red, green, blue). 
The parameter (red, green, and blue) defines the intensity of the color. Use between 0 and 255 as the value of the parameter. 

Here are some examples so you can understand more the RGB value: 
* rgb(255, 0, 0) will result to red, because red is set to its highest value (255) and the others are set to 0. Red is the only one who has a value. Therefore, it will display red. 
* rgb(0, 0, 0) will result to black because all parameters are set to 0. 
* rgb(255, 255, 255) will result to white because all parameters are set to 255. 

Try to experiment by setting different values. 

![Example.png](https://steemitimages.com/DQmZnTLotqD8pRuFLCBV3pFhuEjdiJPmEyDH1TfveBc44TC/Example.png)

Shades of gray are often defined using equal values for all the 3 light sources. 

![Example.png](https://steemitimages.com/DQmYWtDeghGLf3cKRr6tuDLH34wAPmgqMZxdG1z8f3zfiBb/Example.png)

## HEX Value 
We can also use hexadecimal as value of the color. The hexadecimal value looks like this: #rrggbb. rr (red), gg (green) and bb (blue) are the parameters. Use between 00 and ff as the value of the parameter. It's just the same as decimal 0-255 but since this is a hexadecimal 255 is equal to f.

Here's an example: 
* #ff0000 is displayed as red, because red is set to its highest value (ff) and the others are set to the lowest value (00).

![Example.png](https://steemitimages.com/DQmdVkEnWuG5UJbAK4s5QBFEwMqzUa4bcPef8bKgdUKHdEL/Example.png)

Shades of gray are often defined using equal values for all the 3 light sources.

![Example.png](https://steemitimages.com/DQmVsWKfYj5dnnFwmRcU1nthzZ4aPZY7Sig8wwM2yjCo45w/Example.png)

## HSL Value
We can also use HSL (hue, saturation, and lightness) value for changing the colors. HSL value should be written in this form: hsl(hue, saturation, lightness). 

Hue is a degree on the color wheel from 0 to 360. 0 is red, 120 is green, and 240 is blue.
Saturation is a percentage value, 0% means a shade of gray, and 100% is the full color.
Lightness is also a percentage, 0% is black, 50% is neither light or dark, 100% is white

![Example.png](https://steemitimages.com/DQmTC8GTy9wbDCd9HQB8RJcV3n185gKxS7kNGxxWckcgQ1j/Example.png)

### Saturation
Saturation is the intensity of the color. 
* 100% is pure color, no shades of gray
* 50% is 50% gray, but you can still see the color.
* 0% is completely gray, you can no longer see the color.

![Example.png](https://steemitimages.com/DQmPiRYrRKaH28MYqJj1ruRdiYgQcpD1iA8mVLAEM4W7zpc/Example.png)

### Lightness
Lightness is the amount of light you want to give to the color. 
* 0% means no light (black) 
* 50% means 50% light (neither dark nor light) 
* 100% means full lightness (white).

![Example.png](https://steemitimages.com/DQmaELRve23yHSwf9Ti9VzyjsA1c93rVf8Ue3svzoaDzEBY/Example.png)

Shades of gray are often defined by setting the hue and saturation to 0, and adjust the lightness from 0% to 100% to get darker/lighter shades. 

![Example.png](https://steemitimages.com/DQmfUypWZdERte8weDEnZ1uWZkfUsyCZ6QLQoDcGmc4Mr38/Example.png)

## RGBA Value 
Another way of changing the color is using the RGBA  value. It is almost the same with the RGB value but this one has an alpha channel  which specifies the opacity for a color. RGBA is written like this: rgba(red, green, blue, alpha). 

The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all). 

![Example.png](https://steemitimages.com/DQmRgeNLQttzTvyUp2Sv9zhWNFeJQBRszCiLxJUqbiYSqGP/Example.png)

## HSLA Value
The last form we can use for the colors is the HSLA value. It is almost the same as HSL value but it has an alpha channel which specifies the opacity for a color. This is the form for HSLA value: hsla(hue, saturation, lightness, alpha). 

The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all). 

![Example.png](https://steemitimages.com/DQmUZ7hTuHGa3TDpVDYDHFAmTMjSTJfbLMY5dtCVvMAm33h/Example.png)

<hr> 

### HTML 5 Tutorials:
[HTML 5 Tutorial #1 - Introduction](https://steemit.com/steemit/@cj23/html-tutorial-1-introduction)
[HTML 5 Tutorial #2 - HTML Editors](https://steemit.com/steemit/@cj23/html-tutorial-2-html-editors)
[HTML 5 Tutorial #3 - HTML Basic](https://steemit.com/steemit/@cj23/html-5-tutorial-3-html-basic)
[HTML 5 Tutorial #4 - HTML Elements](https://steemit.com/steemit/@cj23/html-5-tutorial-4-html-elements)
[HTML 5 Tutorial #5 - HTML Attributes](https://steemit.com/steemit/@cj23/html-5-tutorial-5-html-attributes)
[HTML 5 Tutorial #6 - HTML Headings](https://steemit.com/steemit/@cj23/html-5-tutorial-6-html-headings)
[HTML 5 Tutorial #7 - HTML Paragraphs](https://steemit.com/steemit/@cj23/html-5-tutorial-7-html-paragraphs)
[HTML 5 Tutorial #8 - HTML Styles](https://steemit.com/steemit/@cj23/html-5-tutorial-8-html-styles)
[HTML 5 Tutorial #9 - HTML Text Formatting](https://steemit.com/steemit/@cj23/html-5-tutorial-9-html-text-formatting)
[HTML 5 Tutorial #10 - HTML Quotation and Citation Elements](https://steemit.com/steemit/@cj23/html-5-tutorial-10-html-quotation-and-citation-elements)
[HTML 5 Tutorial #11 - HTML Comments](https://steemit.com/steemit/@cj23/html-5-tutorial-11-html-comments)
👍  , , , , , , , , , , , , ,
properties (23)
authorcj23
permlinkhtml-5-tutorial-12-html-colors
categorysteemit
json_metadata{"tags":["steemit","steem","blog","philippines","steemph"],"image":["https://steemitimages.com/DQmSeqka7ChoKqsaBRHghteSSoPv25TuFm51bmkGBPWE7b2/Example.png","https://steemitimages.com/DQmY6NGsvmCdLJyCiU247CndjJs2cAG9GqwaZvWUP79qaui/Example.png","https://steemitimages.com/DQmeJ2rueNzEDWNwaqzanGHiwCJbKxxXFcSdaTAvB8W9L35/Example.png","https://steemitimages.com/DQmWKRefUH9LSZCsZj3gFJWZ6YG1MordfDHUReHNezDAyu9/Example.png","https://steemitimages.com/DQmNSXASUMMuWMKbuNVJjeh4n7kKvNpyxDEwsxGwANnuQ4Y/Example.png","https://steemitimages.com/DQmZnTLotqD8pRuFLCBV3pFhuEjdiJPmEyDH1TfveBc44TC/Example.png","https://steemitimages.com/DQmYWtDeghGLf3cKRr6tuDLH34wAPmgqMZxdG1z8f3zfiBb/Example.png","https://steemitimages.com/DQmdVkEnWuG5UJbAK4s5QBFEwMqzUa4bcPef8bKgdUKHdEL/Example.png","https://steemitimages.com/DQmVsWKfYj5dnnFwmRcU1nthzZ4aPZY7Sig8wwM2yjCo45w/Example.png","https://steemitimages.com/DQmTC8GTy9wbDCd9HQB8RJcV3n185gKxS7kNGxxWckcgQ1j/Example.png","https://steemitimages.com/DQmPiRYrRKaH28MYqJj1ruRdiYgQcpD1iA8mVLAEM4W7zpc/Example.png","https://steemitimages.com/DQmaELRve23yHSwf9Ti9VzyjsA1c93rVf8Ue3svzoaDzEBY/Example.png","https://steemitimages.com/DQmfUypWZdERte8weDEnZ1uWZkfUsyCZ6QLQoDcGmc4Mr38/Example.png","https://steemitimages.com/DQmRgeNLQttzTvyUp2Sv9zhWNFeJQBRszCiLxJUqbiYSqGP/Example.png","https://steemitimages.com/DQmUZ7hTuHGa3TDpVDYDHFAmTMjSTJfbLMY5dtCVvMAm33h/Example.png"],"links":["https://steemit.com/steemit/@cj23/html-tutorial-1-introduction","https://steemit.com/steemit/@cj23/html-tutorial-2-html-editors","https://steemit.com/steemit/@cj23/html-5-tutorial-3-html-basic","https://steemit.com/steemit/@cj23/html-5-tutorial-4-html-elements","https://steemit.com/steemit/@cj23/html-5-tutorial-5-html-attributes","https://steemit.com/steemit/@cj23/html-5-tutorial-6-html-headings","https://steemit.com/steemit/@cj23/html-5-tutorial-7-html-paragraphs","https://steemit.com/steemit/@cj23/html-5-tutorial-8-html-styles","https://steemit.com/steemit/@cj23/html-5-tutorial-9-html-text-formatting","https://steemit.com/steemit/@cj23/html-5-tutorial-10-html-quotation-and-citation-elements","https://steemit.com/steemit/@cj23/html-5-tutorial-11-html-comments"],"app":"steemit/0.1","format":"markdown"}
created2018-02-02 11:17:12
last_update2018-02-02 11:17:12
depth0
children6
last_payout2018-02-09 11:17:12
cashout_time1969-12-31 23:59:59
total_payout_value8.840 HBD
curator_payout_value2.209 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,351
author_reputation1,090,777,745,148
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,375,552
net_rshares1,730,776,119,742
author_curate_reward""
vote details (14)
@aliv ·
wow.It's great news.hope everyone like it.keep sharing.it is a knowledheable post.go ahead
properties (22)
authoraliv
permlinkre-cj23-html-5-tutorial-12-html-colors-20180202t111943898z
categorysteemit
json_metadata{"tags":["steemit"],"app":"steemit/0.1"}
created2018-02-02 11:19:48
last_update2018-02-02 11:19:48
depth1
children0
last_payout2018-02-09 11:19:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation2,453,310,833
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,376,066
net_rshares0
@appreciator ·
<p>This post has received gratitude of 0.97 % from @appreciator thanks to: @cj23.</p>
properties (22)
authorappreciator
permlinkre-cj23-html-5-tutorial-12-html-colors-20180204t163932030z
categorysteemit
json_metadata{"tags":["steemit"],"app":"drotto/0.0.3"}
created2018-02-04 16:39:33
last_update2018-02-04 16:39:33
depth1
children0
last_payout2018-02-11 16:39:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length86
author_reputation55,801,543,512,306
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,928,068
net_rshares0
@booster ·
<p>This post has received a 0.63 % upvote from @booster thanks to: @cj23.</p>
properties (22)
authorbooster
permlinkre-cj23-html-5-tutorial-12-html-colors-20180204t162419775z
categorysteemit
json_metadata{"tags":["steemit"],"app":"drotto/0.0.3rc3"}
created2018-02-04 16:24:18
last_update2018-02-04 16:24:18
depth1
children0
last_payout2018-02-11 16:24:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length78
author_reputation68,767,115,776,562
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,924,929
net_rshares0
@cheetah ·
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://www.w3schools.com/html/html_colors.asp
properties (22)
authorcheetah
permlinkcheetah-re-cj23html-5-tutorial-12-html-colors
categorysteemit
json_metadata""
created2018-02-02 11:18:54
last_update2018-02-02 11:18:54
depth1
children0
last_payout2018-02-09 11:18:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length145
author_reputation942,693,160,055,713
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,375,907
net_rshares0
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by cj23 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows.  Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
properties (22)
authorminnowsupport
permlinkre-html-5-tutorial-12-html-colors-20180204t145956
categorysteemit
json_metadata""
created2018-02-04 14:59:57
last_update2018-02-04 14:59:57
depth1
children0
last_payout2018-02-11 14:59:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,700
author_reputation148,902,805,319,183
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,907,645
net_rshares0
@postpromoter ·
re-cj23-html-5-tutorial-12-html-colors-20180204t153326807z
You got a 0.79% upvote from @postpromoter courtesy of @cj23!

Want to promote your posts too? Check out the [Steem Bot Tracker website](https://steembottracker.com) for more info. If you would like to support the development of @postpromoter and the bot tracker please [vote for @yabapmatt for witness!](https://v2.steemconnect.com/sign/account-witness-vote?witness=yabapmatt&approve=1)
properties (22)
authorpostpromoter
permlinkre-cj23-html-5-tutorial-12-html-colors-20180204t153326807z
categorysteemit
json_metadata{"app":"postpromoter/1.8.2"}
created2018-02-04 15:33:27
last_update2018-02-04 15:33:27
depth1
children0
last_payout2018-02-11 15:33:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length387
author_reputation12,722,616,650,811
root_title"HTML 5 Tutorial #12 - HTML Colors"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id34,914,632
net_rshares0