Skip to content Skip to sidebar Skip to footer

Changing HTML Button Font With CSS

I've been trying and failing to change button font with CSS. I can change their background color and I can change a textarea input's font, but for some reason I don't seem to be ab

Solution 1:

It is so simple, you already have it. I think you made a mistake while writing CSS of it, you have a space in input[type=button], though you were pretty close.

<style> 
body {
    font-family: monospace;
}
input[type=button] {
    font-family: monospace;

}
</style>

Solution 2:

You have a spce between input and [type=button]. Remove it and it would work. Try this code.

 input[type=button] {
        font-family: monospace;
    }

Solution 3:

The problem is the space after input. this should work:

<html> 
<head> 
<style> 
    body {
        font-family: monospace;
    }
    input[type = button] {
        font-family: monospace;
    }
    </style> 
</head>
<body> 
    This is a button: 
    <input type = "button" class = "button" value = "Please click"> 
</body> 
</html>

Post a Comment for "Changing HTML Button Font With CSS"