HTML 字体代码

您所在的位置:网站首页 火影颜色字体代码 HTML 字体代码

HTML 字体代码

#HTML 字体代码| 来源: 网络整理| 查看: 265

HTML 字体代码 Example .example1 { font: 16px/22px Garamond, Georgia, serif; color: Orange; } .bold { font-weight: bold; } .italic { font-style: italic; }

This font is 16 pixels, the line height is 22 pixels, its color is orange, and the font family will be 'Garamond'.

If the user's computer doesn't have 'Garamond', it will use 'Georgia'. Failing that it will use the default 'serif' font on the user's computer (this is often 'Times' or 'Times Roman' - just leave it as 'serif').

You can also specify bold text and italics if you wish!

上面的字体代码设置了字体大小、行高、字体系列和字体颜色等常用属性。这里有更多颜色可供选择。

字体属性

在编写 HTML 代码时,CSS 是用于格式化的。以下是 CSS 字体/文本属性:

font font-family font-size font-size-adjust font-stretch font-style font-variant font-weight letter-spacing line-height color background-color text-align text-decoration text-indent text-shadow text-transform

您可以在下面看到其中的一些属性。

字体系列

如果只想指定字体系列,可以使用font-family属性:

Example .example2 { font-family: Helvetica, Arial, sans-serif; }

Example of the CSS font-family property.

字体大小

如果只想指定字体大小,可以使用该font-size属性。您还可以使用该line-height属性来调整每行的高度:

Example .example3 { font-size: 20pt; line-height: 25pt; }

Example of the CSS font-size property along with the line-height property to specify the height of each line.

颜色

如果只想指定字体颜色,可以使用color属性(更多颜色):

HTML font code is done using CSS.

大胆的

您可以使用以下font-weight属性使字体加粗:

HTML font code is done using CSS.

如果你只想加粗一些内联文本,你可以使用 HTML标签:

You can bold parts of your text using the HTML 'span' tag.

斜体文本

您可以使用以下font-style属性使文本变为斜体:

HTML font code is done using CSS.

如果你只想让部分文本斜体,你可以使用 HTML标签:

You can make some of your text italic using the HTML 'span' tag.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3