(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
css.docx
1. Certainly! In CSS (Cascading Style Sheets), you can use various properties to style text, including font-
related properties. Here are some commonly used font properties:
1. **Font Family:**
- The `font-family` property is used to define the font for an HTML element.
- It specifies a prioritized list of font family names and/or generic family names for the selected
element.
```css
body {
font-family: "Helvetica", Arial, sans-serif;
}
```
In this example, the browser will try to use the "Helvetica" font, and if not available, it will fall back
to Arial. If Arial is not available, it will use a generic sans-serif font.
2. **Font Size:**
- The `font-size` property sets the size of the text.
- You can specify the size in various units such as pixels, ems, percentages, etc.
```css
p {
font-size: 16px;
}
```
Alternatively, you can use relative units like `em`:
2. ```css
h1 {
font-size: 2em; /* 2 times the font size of the parent element */
}
```
3. **Font Weight:**
- The `font-weight` property sets the thickness of the characters in a text.
- It can be set to values like `normal`, `bold`, `bolder`, `lighter`, or numeric values (e.g., 400, 700).
```css
strong {
font-weight: bold;
}
```
4. **Text Decoration:**
- The `text-decoration` property is used to set or remove decorations from text.
- Common values include `none` (default), `underline`, `overline`, `line-through`, etc.
```css
a {
text-decoration: none;
}
.underline-text {
text-decoration: underline;
}
3. ```
In this example, the first rule removes the underline from all anchor (`<a>`) elements, while the
second rule underlines text with the class `underline-text`.
These properties can be combined to create a wide variety of text styles. Keep in mind that the
actual appearance may vary depending on the fonts available on the user's system. It's also a good
practice to provide fallback fonts and consider the overall design and accessibility of your web page.