To change your webpage's font, you can use the CSS font-family declaration to specify what font you want to use instead. You've probably seen that font many times in many different contexts, but most webpages will make an effort to move away from Times New Roman, even if only to make themselves look more unique than the default. When no font is specified, most browsers display text in the Times New Roman font. One of the simplest ways to make a major change to the look of the text on a webpage is to change the font.
A pixel in CSS is an abstract unit of measurement that should look about the same size on any device, while the physical pixels on a screen can vary widely between devices. It's also important to note that 1px in CSS does not necessarily correspond to 1 physical pixel on your device screen. For simplicity's sake, though, we'll mostly be sticking to pixels (px) for these tutorials. You can also use a number of other measurements in the font-size declaration to change your text size, such as percentages and relative measurements. However, knowing that the browser's default is about 16px means that you can make some assumptions, like that adding a font-size: 18px declaration will make your text a little bit bigger, as you saw. You probably won't have any frame of reference for how big or small 18px is just by reading the number. If you want your text to be bigger or smaller, though, you can use the CSS font-size declaration to set the size to whatever you want.įor example, you already have one font-size declaration in your styles.css file: font-size: 18px
For most browsers, that size is about 16px, which is short for 16 pixels. When you add text to a webpage-a element, for example-there is a default size at which your browser will display it.