CSS Font Properties


Font Properties
CSS font properties are used to set fonts used in a website. For example, to set font type, font size, weight and font style.

font-family  

Value:
name of the font
Font-family property is used to make the font type to be displayed on the screen. The default is what used browsers, namely Times New Roman. If you want to change to Arial type the following code:
<DIV Style="font-family:Arial"> The font is Arial for this section. </ DIV>

font-size
Value:
number of pixels
percentage
Is a property to indicate the size of the font, the default is medium. To change to 30 pixels, you can type:
<DIV Style="font-size:30px"> The font is 30 pixels in size. </ DIV> 

font-style Value:
normal
italic
oblique

Example:
<DIV Style="font-style:italic"> The font is italic. </ DIV>

font-variant
Value:
normal
small-caps
Example:
<DIV Style="font-variant:small-caps"> The font is small-caps. </ DIV>  

font-weight
Values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
Example:
<DIV Style="font-weight:900"> The font is really bold. </ DIV>

CSS Font Properties
Property
Description
Values
Font
CSS property to set all font property in a declaration
font-style
font-variant
font-weight
font-size/line-height
font-family
caption
icon
menu
message-box
small-caption
status-bar
font-family
Set font type
family-name
generic-family
font-size
Set font size
xx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger
length
%
font-style
Set font style
normal
italic
oblique
font-weight
Set font weight
normal
bold
bolder
lighter

0 comments:

Post a Comment