1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html中斜体样式怎么写 css font-style字体斜体样式

html中斜体样式怎么写 css font-style字体斜体样式

时间:2020-12-20 13:53:01

相关推荐

html中斜体样式怎么写 css font-style字体斜体样式

font-style语法

font-style:取值;

css font-style属性指定文本的字体样式。例如我们将font-style属性设置为italic则表示浏览器会显示一个斜体的字体样式。

font-style属性值

描述

normal

默认值。浏览器显示一个标准的字体样式。

italic

浏览器会显示一个斜体的字体样式。

oblique

浏览器会显示一个倾斜的字体样式。

inherit

规定应该从父元素继承字体样式。

font-style实例

三个段落设置不同的字体样式:

p.normal {font-style:normal;}

p.italic {font-style:italic;}

p.oblique {font-style:oblique;}

This is a paragraph, normal.

This is a paragraph, italic.

This is a paragraph, oblique.

我们看上例就可以知道,font-style属性值为italic或oblique时,在浏览器预览的效果是一样的!那这两者究竟有什么区别呢?

可以这样理解:有些文字有斜体属性,也有些文字没有斜体属性。italic是使用文字的斜体,oblique是让没有斜体属性的文字倾斜。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。