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 html
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
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!