{"id":7921,"date":"2022-09-26T12:59:11","date_gmt":"2022-09-26T12:59:11","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=7921"},"modified":"2022-09-26T12:59:11","modified_gmt":"2022-09-26T12:59:11","slug":"html-colors","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/09\/26\/html-colors\/","title":{"rendered":"HTML Colors"},"content":{"rendered":"\n<p>There are three ways of how you can change the color of the text in HTML: using Hex color codes, HTML color names or RGB values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"hex-color-codes-2\">Hex Color Codes<\/h2>\n\n\n\n<p>A hex color code is a hex triplet, which represents three separate values defining the levels of the component colors. It is specified with a hexadecimal (hex) notation for a mixture of Red, Green, and Blue color values. The lowest value that can be given to one of the light sources is 0 (hex 00). The highest value is 255 (hex FF).<\/p>\n\n\n\n<p>Hex values are written as six-digit numbers, starting with a # sign. Letters used in a hexadecimal digit may be uppercase or lowercase. For example, to specify white color you can write #FFFFFF or #ffffff.<\/p>\n\n\n\n<p>To add a color to the text element, use the\u00a0style\u00a0attribute (where the color property is your Hex code) or corresponding\u00a0CSS properties.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-background-color-property-used-with-the-hex-value-4\">Example of the background-color property used with the &#8220;hex&#8221; value:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n    &lt;style&gt;\n      div {\n        background-color: #1c87c9;\n        color: #d5dce8;\n        padding: 22px;\n      }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;div&gt;\n      &lt;p&gt;This is a text in grey, and the background is blue&lt;\/p&gt;\n    &lt;\/div&gt;\n    &lt;p style=\"color:#8ebf42;\"&gt; This is a text in green&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"result-6\">Result<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/mdr.foobrdigital.com\/wp-content\/uploads\/2022\/09\/image-47.png\" alt=\"\" class=\"wp-image-7922\"\/><\/figure>\n\n\n\n<p>In the table below you can see the Hex values of web colors. You can also use our\u00a0Color Picker\u00a0tool to browse millions of colors with Hex color codes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"html-color-names-8\">HTML Color Names<\/h2>\n\n\n\n<p>To color the text element using an HTML color name, put the name of the color (blue, for ex.) instead of Hex code from the previous step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-color-property-used-with-the-color-name-value-10\">Example of the color property used with the &#8220;color name&#8221; value:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n    &lt;style&gt;    \n      div {\n        background-color: blue;\n        color: white;\n        padding: 22px;\n      }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;div&gt;\n      &lt;p&gt;This is a text in grey, and the background is blue&lt;\/p&gt;\n    &lt;\/div&gt;\n    &lt;p style=\"color:blue;\"&gt; This is a text in blue&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"rgb-color-values-12\">RGB Color Values<\/h2>\n\n\n\n<p>To add a color to the text element, use the&nbsp;style&nbsp;attribute (where the color property is your RGB value) or corresponding CSS properties.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-background-color-property-used-with-the-rgb-value-14\">Example of the background-color property used with the &#8220;RGB&#8221; value:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n    &lt;style&gt;\n      div {\n        background-color:rgb(25,25,112);\n        color: rgb(169,169,169);\n        padding: 22px;\n      }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;div&gt;\n      &lt;p&gt;This is a text in grey, and the background is blue&lt;\/p&gt;\n    &lt;\/div&gt;\n    &lt;p style=\"color:rgb(25,25,112);\"&gt; This is a text in blue&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Here is 216 cross-browser color palette used for creating pages of websites.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/mdr.foobrdigital.com\/wp-content\/uploads\/2022\/09\/image-48.png\" alt=\"\" class=\"wp-image-7923\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>There are three ways of how you can change the color of the text in HTML: using Hex color codes, HTML color names or RGB values. Hex Color Codes A hex color code is a hex triplet, which represents three separate values defining the levels of the component colors. It is specified with a hexadecimal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[285],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/7921"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=7921"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/7921\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=7921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=7921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=7921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}