Text Style with CSS

Text style refers to whether a font is displayed in upright or slanted form. The property used to specify it is font- style. It is inherited and the values it takes are normal, italic, and oblique. Normal is normal or regular font, italic fonts are generally cursive in appearance, while oblique fonts are the slanting versions of normal fonts. It is often hard to differentiate between italic and oblique, so they are interchangeable and it is not unusual where neither is unavailable in a font family for the browser to simulate them by sloping a normal font to achieve it. It is worth noting that using the property to make a text italic is not the same as using the <em> element introduced in Chapter 3, which gives text emphasis and also typically makes it italic. Figure 13.26 shows how the property is used and Figure 13.27 the result. Notice that the same font is used for italic and oblique.

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *