css 文字加粗字体加粗代码有哪些加粗方式

html-css012

css 文字加粗字体加粗代码有哪些加粗方式,第1张

css里文字加粗的步骤如下:

1、首先新建一个17.html。

2、然后输入html5标准声明。

3、输入后可以看到html网页的结构。

4、再在header标签中添加style层叠样式。

5、把body标签的文字加粗。

6、最后使用浏览器打开网页就可以看到字体加粗了,这样css里文字加粗的问题就解决了。

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>test</title>

<style type="text/css">

ul.titlemenu {

margin: 0

padding: 0

}

li.titlemenu {

list-style-type: none

text-align: center

border-bottom: 1px #fff solid

}

a {

font-weight: bolder

font-size: 14px

}

a.titlemenu:link,a.titlemenu:visited,a.titlemenu:active {

display: block

color: #000

background-color: #fff

text-decoration: none

line-height: 50px

padding-left: 14px

}

a.titlemenu:hover {

color: #fff

text-decoration: none

background-color: #3fa200

line-height: 50px

padding-left: 14px

}

</style>

<!-- <script type="text/javascript" src="../jquery-1.8.0.min.js"></script> -->

</head>

<body>

<ul class="titlemenu">

<li class="titlemenu"><a class="titlemenu">abc123你</a>

</li>

</ul>

</body>

</html>

CSS字体加粗的方法:

font-weight 属性设置文本的粗细。使用 bold 关键字可以将文本设置为粗体。

例如:

html:

<p>字体加粗</p>

css:

p{

font-weight:blod

}

css中font样式常用的使用方法:

font-style:规定字体样式

font-weight:规定字体粗细

font-family:规定字体系列

两种方法给字体加粗,一种就是直接用<b>标签,例如 : <b>粗</b>

或者用css添加样式  <div style="font-weight: bold">加粗 </div>

可以用的值有下面这些。400 等同于 normal,而 700 等同于 bold。

normal   默认值

bold   定义粗体字符

bolder   定义更粗的字符

lighter   定义更细的字符

100

200

300

400

500

600

700

800

900