How To Set Font Color In HTML? - Tutorialspoint
Có thể bạn quan tâm
We use the style attribute to set the font color in HTML. The style attribute specifies an inline style for an element, with the CSS color property. The attribute is used with the HTML <p> tag, with the CSS color property. HTML5 do not support the <font> tag, so the CSS style is used to add font color. The <font> tag deprecated in HTML5.
Syntax
<h1 style="color: azure">text…</h1>Example
In the example below, we set the font color of the text inside the <p> tag.
<!DOCTYPE html> <html> <head> <title>HTML Font color</title> </head> <body> <h1>Products</h1> <p style="color:blue">This is demo content.</p> </body> </html>Example
Following is the example program to set font color in HTML.
<!DOCTYPE html> <html> <head> <style> body { background-color: rgb(20,30, 1); } </style> <h1 style="color: azure">HTML Articles</h1> </head> <body> </body> </html>Example: Specifying internal style
We can also specify internal style for an element, with the CSS property color to set font color in HTML. Following is the example program for internal style sheet to set font color in HTML.
<!DOCTYPE html> <html> <head> <style> body { background-color: rgb(20,30, 1); } h1{ color: cyan; } </style> <h1>HTML Articles</h1> </head> <body> </body> </html> Lokesh Badavath Updated on: 29-Aug-2023158K+ Views
Từ khóa » Html Color Text Example
-
HTML Styles - W3Schools
-
HTML Font Tag - W3Schools
-
HTML Text Color - HTML Color Codes
-
HTML | Color Attribute - GeeksforGeeks
-
How To Change Text Color In Html - Javatpoint
-
Changing Colors
-
How To Change The HTML Font Color - Kinsta
-
How To Change Font In HTML - HubSpot Blog
-
Text Color Html Code Example - Code Grepper
-
HTML Font Color Attribute
-
HTML Font Style – How To Change Text Color And Size With An ...
-
HTML Color Codes And Names - Computer Hope
-
#FFFFFF (White) HTML Color Code - Computer Hope
-
Change HTML Background Color Or Font Color - BitDegree