CSS Button Font Sizes

Please Share On:

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:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial