=>Font attributes:
All CSS Font Properties:
- 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").
- 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.
- 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.
2) Font Style:
- The font-style property is mostly used to specify italic text.
- This property has three values:
- Bold - The text is shown in Bold
- italic - The text is shown in italics
- normal - The text is shown normally
3) 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.
4) Font Weight:
- The font-weight property specifies the weight of a font:
- Ex : bold , bolder , lighter , normal
5)Font Variant:
- The font-variant property specifies that the text should be displayed in a small-caps font or not.
- In a small-caps font, all lowercase letters are converted to uppercase letters.
Example :
<html>
<head>
<style type=”text/css”>
H1
{
Font-family : verdana , Arial;
Color : red;
}
P
{
Font-family : “courier new” , verdana ;
Color : green;
}
</style>
</head>
<body>
<h1> css </h1>
<p> cascading style sheet </p>
</body>
</html>
0 Comments