MOCKSTACKS
EN
Questions And Answers

More Tutorials









HTML colors

The RGB value defines HTML color by mixing red, green, and blue values. The first number describes the red color input, the second – the green color input, and the third one – the blue color input.

HTML colors are specified with predefined color names, or with RGB, HEX, HSL, RGBA, or HSLA values.

Color names

Tomato
Slateblue
Orange
mediumseagreen
gray
violet
lightgray
DodgerBlue

Background Color

 <h4style="background-color: tomato">
    The heading tag which have the red background color tomato
</h4>

Example Result

The heading tag which have the red background color tomato


Text Color

<h1 style="text: tomato ">This is a Heading </h1>
<p style="text: mediumseagreen ">Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse natus nulla necessitatibus modi voluptas qui magni beatae obcaecati? Consequatur alias veniam voluptatum sunt eligendi molestiae quia, voluptatibus, voluptates quam odio commodi, modi fugit consectetur. </h3>

Example Result

This is a Heading

Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor molestiae illo eos eius sequi. Molestiae, quidem, veniam inventore blanditiis, magni dolorem facere nisi consequatur officia deleniti omnis ut enim dignissimos vero vel nihil maiores!


Border Color

<h1 style="border: 2px solid violet ">This is a Heading </h1>
<p style="border: 1px solid DodgerBlue ">Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse natus nulla necessitatibus modi voluptas qui magni beatae obcaecati? Consequatur alias veniam voluptatum sunt eligendi molestiae quia, voluptatibus, voluptates quam odio commodi, modi fugit consectetur. </h3>

Example Result

This is a Heading

Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor molestiae illo eos eius sequi. Molestiae, quidem, veniam inventore blanditiis, magni dolorem facere nisi consequatur officia deleniti omnis ut enim dignissimos vero vel nihil maiores!



Conclusion

In this page (written and validated by ) you learned about HTML Colors . What's Next? If you are interested in completing HTML tutorial, your next topic will be learning about: HTML RGB.



Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: mockstacks@gmail.com.


Share On:


Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using Mockstacks.com, you agree to have read and accepted our terms of use, cookies and privacy policy.