HTML Tutorial
HTML XHTML
HTML Media
HTML Advanced
Here's a tutorial on HTML color names:
HTML (Hypertext Markup Language) is the standard markup language used to create web pages. It provides a set of tags and attributes that define the structure and content of a web page. HTML color names are predefined names for colors that can be used in HTML code to style web pages.
Here are some commonly used HTML color names and their corresponding color values:
color: black;
color: white;
color: red;
color: green;
color: blue;
color: yellow;
color: orange;
color: purple;
color: gray;
color: silver;
These HTML color names can be used in CSS (Cascading Style Sheets) code to style HTML elements, such as text and backgrounds. For example, you can use the following code to change the color of a paragraph text to red:
<p style="color: red;">This text is red.</p>
You can also use these HTML color names in combination with other CSS properties, such as background-color, border-color, and more.
In addition to HTML color names, you can also use hexadecimal color codes and RGB values to specify colors in HTML code. However, HTML color names are a convenient way to quickly style HTML elements without having to remember specific color codes.
How to use HTML color names in CSS: HTML color names can be used directly in CSS to set the color of various elements. For example:
body { background-color: aquamarine; color: darkslategray; }
CSS color property with HTML color names:
The color
and background-color
properties in CSS can be set using HTML color names. Example:
h1 { color: darkorchid; background-color: lemonchiffon; }
HTML color names hexadecimal values: While HTML color names are convenient, you can also use hexadecimal values for more precise color control. Example:
p { color: #1E90FF; /* Dodger Blue */ }
HTML color names RGB values: RGB values can also be used for colors. For example:
div { background-color: rgb(255, 99, 71); /* Tomato */ }