HTML font text
HTML font sets the text color (color), size (size) and font (face). The standard HTML text tag starts with the <font> and ends with the </font> tag. The text in the two tags can be do different changes in the HTML4.1 previous version, <font> </ font> tag is a standard grammar text design, but to HTML5 after, the properties of these <font> tag is no longer supported, replaced through CSS 's Syntax design text, whether it is font type, text size or color, you can find new design methods in CSS . The following first introduces the properties of the original HTML font, and attaches CSS alternatives.
HTML font text basic syntax
<font text attribute>displayed text</font>
The text attribute is required. You can write only one of the three attributes, for example, you can write color="color to be presented" as long as you modify the color, or you can write the three attributes together at the same time, such as modifying the color, size and display of the text Fonts can be completed with only one <font> tag. The following are three important attribute tables.
HTML font text attribute table
Attributes | Property value and description | grammar | CSS alternative |
color | Text color | <font color="色码">color</font> | CSS color text color |
size | font size | <font size="1~7">Size</font> | CSS font-size text size |
face | Text font | <font face="字型">Font</font> | CSS font-family font |
Although the above three attributes are simple to use, they are not supported in HTML5 , and CSS alternatives are recommended .
HTML font text example
Property value and description | grammar | Rendering effect |
Text color | <font color="red">red</font> <font color="blue">blue</font> <font color="green">green</font> | Red blue green |
font size | <font size="1">Small characters</font> <font size="4">General</font> <font size="6">Large characters</font> | Small print general characters |
Text font | <font face="serif">serif font</font> <font face="DFKai-sb">Standard Kai-Ti</font> <font face="monospace">monospace font</font> | serif font standard italics monospace font |
In addition to writing the color in English, the attribute value of the text color can also be written in the hexadecimal color code or RGB color code on the " Color Code Table ". The text size is represented by numbers. The number range is from 1 to 7, and the number is larger. The larger the text, the larger the font, there are many common fonts that can be used. For the names of various fonts, please refer to: CSS font-family font . If you want to write all three attributes together, you can write "<font face="font" size="size" color="color">sample text</font>".
Other HTML font special effects
Special effects grammar | Rendering effect |
<b>Bold text</b> | Bold |
<I>Italics</I> | italics |
<u>Text underlined</u> | Underline text |
<spu>Text superscript</spu> | |
<sub>Text subscript</sbu> | Text subscript |
<em>Emphasis</em> | Emphasized text |
<strong>Strengthen text</strong> | Strengthen text |
<code>Source code string</code> | Source code string |
In fact, there are many special effects of HTML font, but with the progress of browsers and HTML , many of the commonly used special effects have been replaced by CSS . Special effects may not be supported by the browser. Designers should use these text effects before , It is recommended to find several browsers to test to see if it can display normally. For CSS alternatives, please refer to: text-decoration .
Post a Comment
0 Comments