“This is the 16th day of my participation in the August More Text Challenge.
The font properties
Font shorthand property Sets all font properties in a single declaration.
The settable properties are (in order) : “font-style font-variant font-weight font-size/line-height font-family”
Font size and font family values are required. If another value is missing, the default value will be inserted, if there is one. (Default value is not Specified)
Note: The line-height property sets the space between lines.
Let’s look at its properties.
The font-family property
The font-family property specifies the font for an element. Font-family can save multiple font names as a "fallback" system. If the browser does not support the first font, the next font is tried. There are two types of font series names: - family-name - Specifies the series name: specifies the font name, for example, "times", "Courier", and "Arial". - generic-family - Generic font series names, such as "serif", "sans-serif", "cursive", "fantasy", and "monospace ". Note: Each value is separated by a comma. Note: If the font name contains Spaces, it must be quoted. When using the "style" attribute in HTML, you must use single quotes.Copy the code
p
{
font-family:"Times New Roman",Georgia,Serif;
}
Copy the code
The font and style attributes
The font-style property specifies the font style for the text. Property Value Value Description Normal Default value. The browser displays a standard font style. The italic browser displays an italic font style. The OBLIQUE browser displays a slanted font style. Inherit specifies that the font style should be inherited from the parent element.Copy the code
p.normal {font-style:normal}
p.italic {font-style:italic}
p.oblique {font-style:oblique}
Copy the code
The font – the size attribute
Font size property sets the font size. Attribute Value Value Description XX-Smallx - SmallSmallMediumlargex-largexx-large Sets the font size to different sizes, from xx-small to xx-large. Default value: medium. Smaller sets font size to smaller than the parent element. Larger Sets font size to the size larger than the parent element. Length sets font-size to a fixed value. % Sets font size to a percentage value based on the parent element. Inherit specifies that the font size should be inherited from the parent element.Copy the code
h1 {font-size:250%}
h2 {font-size:200%}
p {font-size:100%}
Copy the code
The font – weight attribute
Font-weight Specifies the text weight. Value Description Normal Specifies the default value. Define standard characters. Bold defines bold characters. Bolder defines bolder characters. Lighter defines finer characters. 100200300400500600700800900 definition from coarse to fine character. 400 equals Normal and 700 equals Bold. Inherit specifies that the font size should be inherited from the parent element.Copy the code
p.normal {font-weight:normal; } p.thick {font-weight:bold; } p.thicker {font-weight:900; }Copy the code
Color attributes
The Color property specifies the Color of the text. Value Description COLOR_name Specifies the color of the color name (for example, red). Hex_number specifies a color with a hexadecimal value (such as #ff0000). Rgb_number specifies the color value as the RGB code color (such as RGB (255,0,0)). Inherit specifies that the color should be inherited from the parent element.Copy the code
body { color:red; } h1 { color:#00ff00; } p {color: RGB (0,0,255); }Copy the code
Write in the last
These are some CSS styles for fonts. Let’s get started and make your fonts more beautiful!
The above content, if there is a wrong place, welcome to dig friends criticism.