Click here to Skip to main content
16,009,068 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to apply a single font to an entire page, but something is stopping me from doing it.

What I have tried:

I checked online but nothing helped me, some said use this code:

*{
font-family: Verdana;
}


I tried putting it in the body, head, nothing, some said instead of * to use body, tried it, didn't work. I saw if my code even worked in general, I tried to change the font of a single paragraph with a selector and it worked.

*{
font-family: Verdana;
}



what
owo

.btn {
font-size: 55px;
}
.btn-danger {
background-color: red;
}
.btn-success {
background: rgba(128, 0, 0, .25);
font-family: fantasy;
}

blacks111



.Cx {
background-color: grey

}
Posted
Updated 14-Oct-17 23:17pm
Comments
Karthik_Mahalingam 15-Oct-17 5:08am    
post your full html code.

1 solution

CSS
* {
  font-family: Verdana;
}

.btn-success {
  background: rgba(128, 0, 0, .25);
  font-family: fantasy;
}


You probably do not understand how CSS works...
The first rule sets the font for all elements, but the second overrides it for those with class .btn-success
CSS rule order does matter...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900