font-style
Quick Summary for font-style (@font-face)
The font-style CSS descriptor allows authors to specify font styles for the fonts specified in the @font-face rule.
Code Usage for font-style (@font-face)
font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 30deg; font-style: oblique 30deg 50deg; 
More Details for font-style (@font-face)

font-style

The font-style CSS descriptor allows authors to specify font styles for the fonts specified in the @font-face rule.

For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-style descriptor to explicitly specify the font face's style. The values for the CSS descriptor is same as that of its corresponding font property.

Syntax

font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 30deg; font-style: oblique 30deg 50deg; 

Values

normal

Selects the normal version of the font-family.

italic

Specifies that font-face is an italicized version of the normal font.

oblique

Specifies that the font-face is an artificially sloped version of the normal font.

oblique with angle

Selects a font classified as oblique, and additionally specifies an angle for the slant of the text.

oblique with angle range

Selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. Note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed.

Formal definition

Related at-rule@font-face
Initial valuenormal
Computed valueas specified

Formal syntax

normal | italic | oblique <angle>{0,2}

Examples

Specifying an italic font style

As an example, consider the garamond font family, in its normal form, we get the following result:

@font-face {   font-family: garamond;   src: url('garamond.ttf'); } 

The italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees.

On the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, so that it is clear that the font is italicized. True italics use different glyphs and are a bit different from their upright counterparts, having some unique features and generally have a rounded and calligraphic quality. These fonts are specially created by font designers and are not artificially sloped.

@font-face {   font-family: garamond;   src: url('garamond-italic.ttf');   font-style: italic; } 

Specifications

Specification
CSS Fonts Module Level 4 # font-prop-desc

See also

font-display font-family font-stretch font-weight font-variant font-feature-settings font-variation-settings src unicode-range

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)EspañolFrançais日本語中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote

"Olivia, my eldest daughter, caught measles when she was seven years old. As the illness took its usual course I can remember reading to her often in bed and not feeling particularly alarmed about it. Then one morning, when she was well on the road to recovery, I was sitting on her bed showing her how to fashion little animals out of coloured pipe-cleaners, and when it came to her turn to make one herself, I noticed that her fingers and her mind were not working together and she couldn’t do anything. 'Are you feeling all right?' I asked her. 'I feel all sleepy,' she said. In an hour, she was unconscious. In twelve hours she was dead. The measles had turned into a terrible thing called measles encephalitis and there was nothing the doctors could do to save her. That was...in 1962, but even now, if a child with measles happens to develop the same deadly reaction from measles as Olivia did, there would still be nothing the doctors could do to help her. On the other hand, there is today something that parents can do to make sure that this sort of tragedy does not happen to a child of theirs. They can insist that their child is immunised against measles. ...I dedicated two of my books to Olivia, the first was ‘James and the Giant Peach’. That was when she was still alive. The second was ‘The BFG’, dedicated to her memory after she had died from measles. You will see her name at the beginning of each of these books. And I know how happy she would be if only she could know that her death had helped to save a good deal of illness and death among other children."

I just checked google books for BFG, and the dedication is there. 

https://www.google.com.au/books/edition/_/quybcXrFhCIC?hl=en&gbpv=1 


Roald Dahl, 1986
Random CSS Property

scroll-snap-align

The scroll-snap-align property specifies the box's snap position as an alignment of its snap area (as the alignment subject) within its snap container's snapport (as the alignment container). The two values specify the snapping alignment in the block axis and inline axis, respectively. If only one value is specified, the second value defaults to the same value.
scroll-snap-align css reference