Css font properties

457 views
336 views

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
457
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Css font properties

  1. 1. Unit III: Adding Stylesand Interactivity Using CSS and Javascript
  2. 2. CSS Font Properties• The CSS Font Properties allow you to specify the font characteristic such as fonts, font size, font style, etc.
  3. 3. Property Description Examplefont-family Specifies the font h1{font-family: family for text arial, verdana, sans- serif;} h2{font-family: garamond, serif;} h3{font-family: Courier, monospace;}font-size Specifies the font size h1{font-size: 25px;} of text h2{font-size: 13pt;} Value: pixel, point or h3{font-size: 115%} percentagefont-style Specifies the font style h1{font-style: for text oblique;} Value: h2{font-style: italic normal, oblique, or italic
  4. 4. Property Description Examplefont-variant Specifies whether or h1{font-variant: not a text should be small-caps;} displayed in a small- h1{font-variant: caps font or normal normal;} fontfont-weight Specifies the weight h1{font-weight: of a font to normal bold;} or bold h1{font-weight: normal;}font Sets all the font h1{font: oblique properties in one bold 20px “Times declaration New Roman”, sans serif;}
  5. 5. COMPUQUIZ1. Write the CSS code to set the font to Broadway.2. Write the CSS code to set the font size to 16pt.3. Write the CSS code to set the font style to italic.4. Write the CSS code to set the font to small caps.5. Write the CSS code to set the font to bold.6. Write the CSS code to set 1-5 in one declaration.
  6. 6. Answer• 1.body{font-family:broadway;}2. body{font-size: 16pt;}• 3.body{font-style: italic;}• 4. body{font-variant:small-caps;}• Body{font-weight: bold;}• Body{font : broadway 16pt italic small-caps bold;}

×