Home > Article > Web Front-end > How to remove italic style from em tag in css
In CSS, you can use the "font-style" attribute to remove the italic style of the em tag. The function of this attribute is to define the style of the font. When the value of the attribute is "normal", the font is displayed in the standard style. , that is, the italic style is removed, and the syntax is "em{font-style:normal;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
How to remove the italic style of the em tag in css
In css, you can use the font-style attribute to remove the italic style of the em tag. The font-style attribute defines the style of the font. When the value of the attribute is normal, the font style is the standard style.
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> .em1{ font-style:normal; } </style> </head> <body> <em class="em1">这是一段文字</em><br> <em>这是一段文字</em> </body> </html>
Output result:
(Learning video sharing : css video tutorial)
The above is the detailed content of How to remove italic style from em tag in css. For more information, please follow other related articles on the PHP Chinese website!