DIV CSS文字粗体字如何实现 html文字粗体字体加粗如何设置

html-css08

DIV CSS文字粗体字如何实现 html文字粗体字体加粗如何设置,第1张

一、使用html 加粗标签

使用b标签或strong标签即可对文字粗体。

1、分别对应语法如下:

<b></b>

<strong><strong>

2、应用案例

1)、html案例完整代码(可以拷贝测试):

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html charset=utf-8" /> <title>粗体实现 DIVCSS5案例</title> </head> <body> 我是正常字体<br /> <b>我被b粗体</b><br /> <strong>我被strong粗体</strong> </body> </html>

二、使用CSS样式实现文字粗体显示   -   TOP

div+css布局中,使用css样式实现文字字体粗体比较多的,只需要对对象设置一个粗体样式属性即可实现文本粗体,又称为css文字粗体。

1、css粗体样式基础

1)、单词与介绍

font-weight,值为可以为从100到900,和bold,最常用font-weight的值为bold,也是所有浏览器均兼容。

2)、css 粗体语法:

div{font-weight:bold}

这样就让所有div对象内文字字体加粗

<!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>