How to set the font size in the button with css

青灯夜游
Release: 2022-01-20 18:54:51
Original
7798 people have browsed it

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>
Copy after login

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

button{
  width:100px;
  height:60px;
}
Copy after login

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;
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!