Set the text size of a button in HTML
In this tutorial, we are going to learn about how to set the text size of a button in HTML.
Consider, we have the following button element in our HTML:
<button class="btn">Google</button>
To set the text size of a button, add the font-size : 20px
property to the button
CSS class.
Here is an example:
<button class="btn">Google</button>
CSS:
.btn{
font-size : 20px;
}
In the example above, we have increased the text size of a button to 20px
.
or we can add the inline styles to button element using the style
attribute in HTML.
<button style="font-size: 20px;">Google</button>