Home > Web Front-end > Front-end Q&A > How to set i not italic in css

How to set i not italic in css

WBOY
Release: 2022-04-20 10:36:12
Original
2471 people have browsed it

In CSS, you can use the "font-style" attribute to set the i element not to be italic. This attribute is used to specify the font style of the text. When the attribute value is set to "normal", the standard of the element will be displayed. Font style, the syntax is "i element {font-style:normal}".

How to set i not italic in css

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to set i not italic in css

The font-style attribute specifies the font style of the text.

Defines a portion of text that is different from the rest of the text and renders this portion of text in italics.

font-style attribute values ​​are as follows:

  • normal Default value. The browser displays a standard font style.

  • italic The browser will display an italic font style.

  • oblique The browser will display an oblique font style.

  • #inherit Specifies that the font style should be inherited from the parent element.

The example is as follows:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>123</title>
<style>
i.normal {font-style:normal;}
</style>
</head>
<body>
<i class="normal">这是一个设置了不是斜体的i元素</i><br>
<i>这是一个正常i元素</i>
</body>
</html>
Copy after login

Output result;

How to set i not italic in css

(Learning video sharing: css video Tutorial)

The above is the detailed content of How to set i not italic in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template