CSS and Fonts
To change the font on your page, the font-family CSS property is used:
You can specify a single font instead, but not everybody has that fancy font you like so much. In which case, they would get the default, which is usually a serif font.
NOTE: A serif is mark or embellishment on the vertical or horizontal line of text. Here's an example of the serif font Times New Roman:
Courier New, Courier, Mono
Georgia, Times New Roman, Times, Serif
Verdana, Arial, Helvetica, Sans-Serif
Geneva, Arial, Helvetica, San-Serif
But your browser should look like this:
In the next lesson, you'll learn about font colours.
Wednesday, 8 July 2015
CSS and Fonts
<FONT face="Arial, Helvetica, san-serif">Some text here</FONT>
However, In HTML 5 the FONT tag is deprecated. That doesn't mean you can't use it anymore, as browsers are backward compatible, meaning that older code will work with all browsers. But if you want to go with the modern way of doing things then fonts, font sizes, and font colours should be done with a Stylesheet.
font-family: arial, helvetica, sans-serif;
You specify the family because the person viewing your page might not have the first font on your list. In which case, the second font is tried, then the third. (You can have more than three, if you want. Or less than three.)
Times New Roman, Times, Serif
Try them out for yourself with the following font-family style added to your H1 code:
0 comments:
Post a Comment