CSS Font Properties – Changing how text looks

CSS

0 Comments

The font properties in CSS allow you to change how text looks.

Example

<style>
	.btn {
		...

		font-weight: bold;
		font-family: Arial, sans-serif;
		font-size: 14px;
	}

    ...
</style>

<input type="button" class="btn" value="Button 1">
<input type="button" class="btn gray" value="Button 2">

Result

font-weight property
Sets how bold the font is. Common values are bold and normal.
font-family property
Changes the font for the text. Multiple fonts can be specified (separated by commas) in case the first choice isn't available. Keep in mind that PCs and macs don't always have the same fonts.
font-size property
How large the font should be.

Practice in Editor

Leave a Comment