codegurukool.com · Free coding tutorials & online compiler

Home › HTML Tutorial › HTML colors

HTML colors

Name, hex, RGB, HSL.

Set colors with names, #rrggbb, rgb(), hsl() and add transparency with rgba().

Example code

<p style='background:tomato'>Name</p>
<p style='background:#2e86de'>Hex</p>
<p style='background:rgb(27,153,139)'>RGB</p>
<p style='background:hsl(45,100%,60%)'>HSL</p>
<p style='background:rgba(0,0,0,.2)'>RGBA</p>'

Run this code in the online editor

← HTML commentsCSS in HTML →