Home  >  Article  >  Web Front-end  >  How to set font attributes in html

How to set font attributes in html

藏色散人
藏色散人Original
2021-05-20 11:06:554360browse

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.

How to set font attributes in html

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

How to set font attributes in html

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

How to set font attributes in html

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

How to set font attributes in html

As shown in the figure, set the text to After 12 pixels, the character size changes

How to set font attributes in html

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.

How to set font attributes in html

As shown in the picture, set the text to red

How to set font attributes in html

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.

How to set font attributes in html

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!

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