How to Use Hexadecimal Color Codes in HTML
There are a number of different methods to use the colors in designing the web pages of HTML documents and color the embedded text and images. One of these is hexadecimal color codes in HTML web designs. These hexadecimal codes can also be used for designing XHTML and CSS web pages. Another color code named decimal color code is used for CSS and graphic tools.
Hexadecimal color codes in HTML begin with a hash (#). One of the ways of specifying a color in hexadecimal format is RGB triplet. The usual range for RGB is 0 to 255 (00 to FF).
As there are other ways also available for specifying RGB values such as a range from 0 to 1, so it is required to convert these numbers to hex values before using in designs. One can multiply this value with 255 and then convert to hexadecimal values. For example 184 can be represented in hex as #B8.
A 3 byte hexadecimal representation known as hex triplet is used in CSS, HTML and CVG to specify colors. Here each byte represents one of Red, Green or Blue colors. As the range is from 0 to 255, the lowest intensity color is represented with 0 and the most intensity with 255.
Now each component of RGB has 256 different values, so the total number of colors values is 256 × 256 × 256 = 16,777,216. This is such a huge number that you can create so many different shades by varying each value to different level. The grey color shade is the unique one, which is created by an equal intensity of each of the color value.
Recent Topics
- Working with Images in HTML Documents
- Webpage Forms in HTML
- Web Safe Colors in HTML
- Use Ordered Lists in a Webpage
- Top Graphic Editing Software in Webpage Design
- Tables and Frames in HTML
- Structure of an HTML Document
- Setup Cascade Style Sheets (CSS) in HTML files
- HTML and XHTML in Webpage Creation
- HTML and Meta Tags for Search Engine Optimization
- How to Validate HTML File
- How to Use Hexadecimal Color Codes in HTML
- How to Create Website Banners
- Formatted Lists in HTML Document
- Embedding HTML in PHP





