0% found this document useful (0 votes)
125 views

Difference Between Serif and Sans-Serif Fonts

The document discusses CSS font properties including font family, style, and size. It defines generic and specific font families, and describes how font-style can be set to normal, italic, or oblique. Font size can be set absolutely or relatively, and it is best to use proper HTML tags for headings and paragraphs rather than adjusting font sizes.

Uploaded by

Alex Mociran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Difference Between Serif and Sans-Serif Fonts

The document discusses CSS font properties including font family, style, and size. It defines generic and specific font families, and describes how font-style can be set to normal, italic, or oblique. Font size can be set absolutely or relatively, and it is best to use proper HTML tags for headings and paragraphs rather than adjusting font sizes.

Uploaded by

Alex Mociran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

The CSS font properties define the font family, boldness, size, and the style

of a text.

Difference Between Serif and Sans-serif


Fonts

CSS Font Families


In CSS, there are two types of font family names:

generic family - a group of font families with a similar look (like "Serif"
or "Monospace")

font family - a specific font family (like "Times New Roman" or "Arial")

Generic family

Font family

Description

Serif

Times New Roman


Georgia

Serif fonts have small

Sans-serif

Arial

"Sans" means withou


of characters

Verdana
Monospace

Courier New
Lucida Console

All monospace charac

Note: On computer screens, sans-serif fonts are considered easier to read than serif fo

Font Family
The font family of a text is set with the font-family property.
The font-family property should hold several font names as a "fallback"
system. If the browser does not support the first font, it tries the next font, and
so on.
Start with the font you want, and end with a generic family, to let the browser
pick a similar font in the generic family, if no other fonts are available.
Note: If the name of a font family is more than one word, it must be in
quotation marks, like: "Times New Roman".
More than one font family is specified in a comma-separated list:

Font Style
The font-style property is mostly used to specify italic text.
This property has three values:

normal - The text is shown normally

italic - The text is shown in italics

oblique - The text is "leaning" (oblique is very similar to italic, but less
supported)

Example
p.normal {
font-style: normal;
}
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}

Try it yourself

Font Size
The font-size property sets the size of the text.
Being able to manage the text size is important in web design. However, you
should not use font size adjustments to make paragraphs look like headings, or
headings look like paragraphs.
Always use the proper HTML tags, like <h1> - <h6> for headings and <p> for
paragraphs.
The font-size value can be an absolute, or relative size.
Absolute size:

Sets the text to a specified size

Does not allow a user to change the text size in all browsers (bad for
accessibility reasons)

Absolute size is useful when the physical size of the output is known

Relative size:

Sets the size relative to surrounding elements

Allows a user to change the text size in browsers

You might also like