Home > Article > Web Front-end > How to write css italic style
In CSS, you can use the "font-style" attribute to implement the italic style of text. The syntax is "font-style:italic|oblique", where italic is the italic style and oblique is the oblique style.
The operating environment of this tutorial: Windows7 system, CSS3&&HTML5 version, Dell G3 computer.
Italic text is often used by people. Italics in CSS are achieved by setting the font-style
attribute.
<span> <title> 文字斜体 </title> <style> h1{font-style:italic;} h1 span{font-style:normal;} p{font-size:18px;} p.one{font-style:italic;} p.two{font-style:oblique;} </style> <h1>文字<span>斜</span>体</h1> <p>文字斜体</p> <p>文字斜体</p> </span>
The above code sets the text style to italic. However, adding the tag to the tag will change the font that has been italicized. , and set it to the standard style.
Recommended learning: css video tutorial
The above is the detailed content of How to write css italic style. For more information, please follow other related articles on the PHP Chinese website!