We can use the color property to change the color of the text on your web page. We can specify a recognized color name, a hexadecimal color value, or an RGB value. We can change the text color to make it match the theme of your website. You can use color to emphasize important content, such as alert text or error messages. we can also use the color property to change other web page elements, such as tables borders, and horizontal rules.
Change the color of the text
Use a color name
Step 1: Click inside the tag declaration and type color: following ba a space
Step 2: Type a color name for the color you want to assign.
Result Output
<!DOCTYPE html> <html> <Head> <Title>Coding thai</Title> <style> p{ font-family: arial; font-size: 15px; text-indent: 50px; color: green; } </style> </Head> <body> <h1>Types of Web Developer</h1> <hr> <Section class="First"> <p> A front end developer has one general responsibility: to ensure that website visitors can easily interact with the page. and Back-end developers are the experts who build and maintain the mechanisms that process data and perform actions on websites.</p> </Section> <hr> <small> ©Copyright 2022 Codingthai</small> </body> </html>
Use a hexadecimal code
step 1: click inside the tag declaration and type color: followed by a space.
Step 2: type a hexadecimal value for the color you want to assign.
Result Output
<!DOCTYPE html> <html> <Head> <Title>Coding thai</Title> <style> p{ font-family: arial; font-size: 15px; text-indent: 50px; color: #336699; } </style> </Head> <body> <h1>Types of Web Developer</h1> <hr> <Section class="First"> <p> A front end developer has one general responsibility: to ensure that website visitors can easily interact with the page. and Back-end developers are the experts who build and maintain the mechanisms that process data and perform actions on websites.</p> </Section> <hr> <small> ©Copyright 2022 Codingthai</small> </body> </html>
What color can I set for my web page text?
You can set the color using a six-digit hexadecimal value preceded by a number sign(#), as shown in the following table. In a hexadecimal code, the three pairs of digits or letters after the # control the amount of red, green, and blue in the color respectively browser can also understand the color name listed below.
Color | Hexadecimal Value | Color | Hexadecimal Value |
Aqua | #00ffff | Navy | #000080 |
Black | #000000 | Olive | #808000 |
Blue | #0000ff | Purple | #800080 |
Fuchsia | #ff00ff | Red | #ff0000 |
Gray | #808080 | Silver | #c0c0c0 |
Green | #008000 | Teal | #008080 |
Lime | #00ff00 | White | #ffffff |
Maroon | #800000 | Yellow | #ffff00 |