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 Tag Font
-
HTML Font Tag - W3Schools
-
HTML Styles - W3Schools
-
HTML | Color Attribute - GeeksforGeeks
-
HTML: Tag - TechOnTheNet
-
HTML Font Style – How To Change Text Color And Size With An ...
-
How To Change The HTML Font Color - Kinsta
-
HTML Font Color Attribute
-
HTML/Text Tags/font Size And Color - TAG Index
-
How To Change Font In HTML - HubSpot Blog
-
HTML Text Color - HTML Color Codes
-
How To Change The Font Type, Size, And Color On A Web Page
-
HTML Font Color - Javatpoint
-
HTML Fonts — How To Change Font Color In HTML - TutorialBrain