Home > Article > Web Front-end > How to set font attributes in html
How to set font attributes in html: First, create an h1 tag in the html file; then write the css style in the style; then set the text size attribute to "font-size:12px"; finally pass " color:red;" attribute can set the font color.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer
In the html file, create an h1 tag, and then put it in it Enter a few words for demonstration. h1 is the title tag, which itself has unique title attributes
As shown in the figure, you can see in the browser that the h1 title The label itself has the effect of enlarging and bolding the font
If we want to change the text size and color settings, we need to write the css style in style,
That is, for the label attribute of h1, the text size attribute is font-size:12px; followed by the numerical size
As shown in the figure, set the text to After 12 pixels, the character size changes
color: red; is the color attribute setting of the text, color color, followed by the attribute value, you can enter the English color, or Entering RGB values is also possible.
As shown in the picture, set the text to red
The bold effect attribute of ordinary text is font-weight: bold; if you encounter unmodified text that is bold, you can use the bolding effect of font-weight.
Recommended learning tutorials: html video tutorial, css video tutorial
The above is the detailed content of How to set font attributes in html. For more information, please follow other related articles on the PHP Chinese website!