CSS中设定字体如何设定为微软雅黑Bold字体?

html-css010

CSS中设定字体如何设定为微软雅黑Bold字体?,第1张

1、首先要了解css中是如何控制字体的。\x0d\x0afont:在一个声明中设置所有字体属性;\x0d\x0afont有以下几个属性:\x0d\x0a\x0d\x0afont-style:字体样式\x0d\x0a\x0d\x0afont-variant:字体异体\x0d\x0afont-weight:字体粗细\x0d\x0afont-size/line-height:字体大小/行高\x0d\x0afont-family:字体系列(比如宋体、黑体等)\x0d\x0a2、知道这些之后,那"设定字体为微软雅黑Bold字体"就可以这么写:\x0d\x0afont-family:"微软雅黑"font-weight:bold\x0d\x0a但是需要注意一点,通常我们使用中文字体的时候,都会使用的英文名称,而不是直接使用中文;而且,也会使用简写的形式;如下:\x0d\x0afont:bold12px/1.5em"MicrosoftYaHei"

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<style>标签中,输入css代码:。

<div style="position: relativewidth: 300pxheight: 80pxborder: 1px solid blue">

<strong style="position: absoluteright: 0top: 0">获取更多</strong>

</div>

3、浏览器运行index.html页面,此时“获取更多”的链接文字移动到条形栏的中间位置了。