Home  >  Article  >  Web Front-end  >  Setting font style in html

Setting font style in html

不言
不言Original
2018-07-19 15:28:3010720browse

The setting of font size and color in HTML is to encapsulate the text through tags, and then set the font style differently by changing the attributes of the tags. It can be completed with a few lines of code.

Example

<head>
        <title>这是一个html文件</title>       <!---head标签中进行相应的设置,这里设置了一个标题->
</head>
<body>
        <font size="5",color="red">php中文网1</font><br/>
        <font size="6",color="green">php中文网2</font><br/>
        <font size="7",color="blue">php中文网3</font><br/>
</body>

The corresponding title is set in the head, and the three lines of text are displayed in different ways. In real life, websites such as news media are not Each line of text is displayed in the same color or style (the entire webpage uses one format or color will be very monotonous), so to display different text in different formats, you need to use tags to process Wrap (encapsulate) the text, and set the corresponding style of the wrapped content by changing the attribute value of the label

The text label in html16b742b78805c1d4ee5ad67b632e4796e6e38b3c62e8df885fe2e3986461aa63

Set the attributes of the text, including two attribute values: size (font size) and color (font color)

The font size The range is 1-7. If the font size is set to exceed 7 during the encoding process, the displayed size will still be 7

font color, two representation methods, one is English word representation : write, blue, green, ren..........

But the colors represented by English words are limited, html provides another way of expressing colors: #ffffff , starting with #, six hexadecimal characters, each two represents a primary color (RGB). The values ​​of these three primary colors can be obtained with corresponding tools

Related recommendations:

HTML web page font size setting

Detailed explanation of the method of setting font color in html and the method of using ps to obtain the accurate font color of html

The above is the detailed content of Setting font style 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