Definition:
CSS button font-size can be used to change the font-size of buttons. See an example below to understand clearly.
Syntax:
.btn1 {font-size: 10px;}
.btn2 {font-size: 12px;}
.btn3 {font-size: 14px;}
.btn4 {font-size: 16px;}
Source Code:
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: green;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
}
.btn1 {font-size: 10px;}
.btn2 {font-size: 12px;}
.btn3 {font-size: 14px;}
.btn4 {font-size: 16px;}
</style>
</head>
<body>
<h2>CSS Button different font-size</h2>
<button class="button btn1">10px</button>
<button class="button btn2">12px</button>
<button class="button btn3">14px</button>
<button class="button btn4">16px</button>
</body>
</html>
Output:
Donate to support writers.
You may be interested in the following topics:
- CSS Button On Image
- CSS Button Animation
- CSS Button Groups
- CSS Disabled Button
- CSS Button Shadows
- CSS Hoverable Buttons
- CSS Button Borders
- CSS Button Shape
- CSS Button Width
- CSS Button Font Sizes
- CSS Button Colors
- CSS Buttons (All Properties)