First off, quotes wrapped around a font-family
name is only necessary if the name consists of multiple words (ex. "New Roman Times"), so wrapping Raleway in quotes is pointless.
:root
:root
is the <html>
tag with a higher priority than html
. This selector should be on top of the stylesheet (there might be a few selectors that could preceed it like *
). Place the font
properties here and it will be the global default for the whole page. The font-size
value set here will be the base value for 1rem
.
:root { font: 2ch/1.25 Raleway; }
input, textarea, select, button
The only tags that will not conform to the default are <input>
, <textarea>
, <select>
, and <button>
. Here is the ruleset I use (it varies for font-size
and line-height
depending on personal preference):
input, textarea, select, button { font: inherit; line-height: 1.15; }
Also, if you are using Bootstrap, you'll most likely need to override BS styles. There are two effective ways to do so:
Double Selectors will double specificity
.btn.btn { font-family: Raleway; }
!important
overrides anything (not recommended)
.btn { font-family: Raleway !important }
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@500&display=swap');
:root {
font: 2ch/1.25 Raleway;
}
p {
font-size: 1rem;
}
input {
font: inherit;
line-height: 1.15;
}
<h1>Raleway</h1>
<input placeholder='Raleway'>
<p>Almost before we knew it, we had left the ground.</p>
<blockquote>
<q>Almost before we knew it, we had left the ground.</q>
</blockquote>