> For the complete documentation index, see [llms.txt](https://mentorship101.gitbook.io/mentorship-101/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mentorship101.gitbook.io/mentorship-101/css-basics/css-colors.md).

# CSS Colors

How to add colors to html elements

Colors are added when we need to change color of text or border. Lets get into this. I am going to use **inline css.**

The block of code below can also be found on [github](https://github.com/Nicanor008/Mentorship-101/blob/master/css/colors.html)

{% code title="colors.html" %}

```
<html>
<head>
    <title>CSS Colors</title>
</head>
<body>
    <div style="border:2px dotted red">
        <h1 style="color:blue">CSS COLORS</h1>
        <p style="color:rgb(165, 71, 71)">This is color code css color</h1>
        <p style="color:#ee82ee">This is hex(hexadecimal) color code</p>
    </div>
</body>
</html>
```

{% endcode %}

On running this on browser, you should see this,

![](https://4037691551-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbyiXaZSs-vDRSOJfOk%2Fuploads%2Fgit-blob-bbecef2675d62ccf573d161071b40f4fe127c6fc%2FScreen%20Shot%202019-04-09%20at%2017.07.14.png?alt=media)
