Home  >  Article  >  Web Front-end  >  How to set italic style in css

How to set italic style in css

青灯夜游
青灯夜游Original
2021-04-16 14:29:4320987browse

You can use the font-style attribute to set the italic style in css. You only need to set the "font-style:italic;" or "font-style:oblique;" style to the text element; the value is "italic" Represents an italic style, the value "oblique" represents an oblique style.

How to set italic style in css

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

css sets italic style

You can use the font-style attribute in css to set italic style, example:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<style type="text/css">
			p.italic {
				font-style: italic
			}
		</style>
	</head>

	<body>
		<p>测试文本,正常字体。</p>
		<p class="italic">测试文本,倾斜字体。</p>
		<p class="italic">测试文本,倾斜字体。</p>
	</body>

</html>

Rendering:

How to set italic style in css

css font-style attribute

The font-style attribute defines the style of the font.

Attribute value:

  • 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.

(Learning video sharing: css video tutorial)

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

Statement:
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
Previous article:why css doesn't workNext article:why css doesn't work