How do you change font for all buttons using CSS?
Experience Level: Junior
Tags: CSS
Answer
In order to change the style of all buttons, you need to first define what HTML code is used to represent buttons on your website.
Usually the following tags are used to create buttons:
So you will need to create multiple styles to cover multiple different tags:
Buttons using tag
Note that tag is usually used as a link so in order to make it look like a button, you should add it some class:
Click me
When you have all link buttons marked by this class, you can simply define the button class using the following selector:
a.btn {
font-size: 14px;
font-samily: Verdana;
}
Related CSS job interview questions
How do you hide some element using CSS?
CSS JuniorHow do you set fixed width of specific div element?
CSS JuniorHow do you set margin on each side of a div element to different value?
CSS JuniorWhat is a differene between margin and padding and what are they used for?
CSS JuniorHow do you set text color using CSS?
CSS Junior