Home  >  Article  >  Web Front-end  >  How to set the font size in the button with css

How to set the font size in the button with css

青灯夜游
青灯夜游Original
2022-01-20 18:54:517720browse

How to set the font size in the button in css: 1. Add the class attribute to the button element and set the attribute value; 2. Use the class selector to select the button element and add the "font-size: value px;" style. Can.

How to set the font size in the button with css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to change the font size of buttons in css

1. First, create two buttons on the page and define the class class For comparison;

 <body>
   <button type="button" class="btn">字体为20px</button>
   <button type="button" >正常字体</button>
 </body>

2. After the button is created, set the width and height of the button in css;

button{
  width:100px;
  height:60px;
}

3. After the width and height of the button are set, use the font-size attribute You can change the size of the font in the button;

 .btn {
  font-size:20px;
}

Effect:

How to set the font size in the button with css

(Learning video sharing: css video tutorial)

The above is the detailed content of How to set the font size in the button with css. 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