<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="img/mynote.ico"/>
<title>font字体</title>
<style type="text/css">
div {
position: relative;
left: 100px;
top: 100px;
background: gold;
width: 200px;
height: 50px;
/*文本水平居中*/
text-align: center;
/*字体大小*/
font-size: 30px;
/*行高:一般设置与div高度一样,实现垂直居中*/
line-height: 50px;
/*字体样式:
italic 浏览器会显示一个斜体的字体样式。
oblique 浏览器会显示一个倾斜的字体样式。*/
font-style: oblique;
/*字体粗细*/
font-weight: 900;
/*更改字体类型*/
font-family: arial;
}
</style>
</head>
<body>
<div>font字体</div>
</body>
</html>