Home >Web Front-end >CSS Tutorial >How to make fonts tilt in css
In CSS, you can use the "font-style" attribute to make the font appear oblique. This attribute is used to define the style of the font. When the value of the attribute is "oblique", the element will be displayed in an oblique font style. , just add the "font-style:oblique" style to the text element.
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
How to tilt the font in css
In css, you can use the font-style attribute to tilt the font. This attribute is set to use italic, italic or Normal font. An italic font is usually defined as an individual font within a font family. Theoretically, the user agent can calculate an italic font based on the normal font.
The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> p{ font-style:oblique; } </style> </head> <body> <p>这是一段倾斜的文字</p> </body> </html>
Output result:
##(Learning video sharing:css video tutorial)
The above is the detailed content of How to make fonts tilt in css. For more information, please follow other related articles on the PHP Chinese website!