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.
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:
(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!