Home >Web Front-end >HTML Tutorial >Attributes of font tag in html

Attributes of font tag in html

下次还敢
下次还敢Original
2024-04-27 20:57:34472browse

Font tag attributes: Color attribute (color): Specify text color Font attribute (face): Specify font size attribute (size): Specify text size alignment attribute (align): Specify text alignment language code attribute ( lang): Specify the text language code style attribute (style): Specify the text style (bold, italic, underline)

Attributes of font tag in html

Attributes of the HTML Font tag

Font tag is used to define the font, size and color of text. It has the following properties:

Color property

  • color:Specifies the text color, you can use hexadecimal codes, English words or RGB value.

Font attribute

  • face: Specifies the font, which can be any font supported by the browser.
  • size: Specifies the text size, from 1 to 7, where 1 is the smallest and 7 is the largest.

Alignment attribute

  • align:Specifies the alignment of the text, which can be left (left aligned), right ( Right-aligned), center (centered), or justify (justified).

Other attributes

  • lang: Specify the language code of the text.
  • style: Specify the style of the text, which can be bold (bold), italic (italic), underline (underline) or normal (normal).

Usage example

<code class="html"><font color="red" face="Arial" size="4">这是红色 Arial 字体大小 4 的文本。</font></code>

Note

  • Font tag has been deprecated in HTML5, It is recommended to use CSS style sheets to control the style of text.
  • Different browsers may have different support for the font tag, so it is recommended to use it with caution.

The above is the detailed content of Attributes of font tag in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:The role of table in htmlNext article:The role of table in html