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 Style
-
HTML Styles - W3Schools
-
HTML Font Tag - W3Schools
-
HTML Font Style – How To Change Text Color And Size With An ...
-
HTML Text Color - HTML Color Codes
-
How To Change Font In HTML - HubSpot Blog
-
HTML | Color Attribute - GeeksforGeeks
-
How To Change Text Color In Html - Javatpoint
-
How To Change The Font Type, Size, And Color On A Web Page
-
How To Change The HTML Font Color - Kinsta
-
Change HTML Background Color Or Font Color - BitDegree
-
HTML Font Color Attribute
-
How To Change Text Color In Html - Linux Hint
-
5.1 Font Color | R Markdown Cookbook - Bookdown
-
CSS Code Example For Font Color (And Why HTML Is Forbidden) »