html如何设置字体为斜体

html-css014

html如何设置字体为斜体,第1张

给文字设置斜体可以通过i标签实现,示例如下:

<i>倾斜</i>

不过现在不是很推荐这种写法,可以通过css的方式给文字设置斜体。

属性为font-style,值有两个可供选择,italic和oblique这两个值,倾斜度有些区别。

将字体设为斜体用的标签

在HTML语言中,将文字以斜体形式显示,可以使用的标记是:

<i>sdfsd</i>

//用i标签直接将文字变成斜体

<p

><i>sdfsdfsdfsdf</i>

//这样的话也是斜体

<b></b>

粗体文本

<i></i>

倾斜文本

这可以单独成在,在<font>中有属性color

\face\size

两种方法:

方法

1:

<font

style="font-weight:boldfont-style:italic">aaaaa</font>

方法2:

<style

type="text/css">

font

{font-weight:boldfont-style:italic}

</style>

<font>aaa</font>

<b></b> 粗体文本

<i></i> 倾斜文本

这可以单独成在,在<font>中有属性color \face\size