CSS 属性
1)字体、文本
font-size:字体大小
color:文本颜色
text-align:对其方式
line-height:行高
2)背景: background
3)边框:border:设置边框,符合属性
4)尺寸
width:宽度
height:高度
例子:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css属性</title>
<style>
p{
color: #FF0000;
font-size: 30px;
text-align: center;
/*行高*/
line-height: 200px;
/*
border 边框
*/
border: 2px solid deeppink;
}
div{
color: #FFD026;
border: 10px solid deepskyblue;
/*
尺寸 :宽度 高度
*/
height: 200px;
width: 200px;
/*
背景 no-repeat center 不重复 居中显示
*/
background: url("img/3.jpeg") no-repeat center;
}
</style>
</head>
<body>
<p>美丽的西湖</p>
<div>
可爱的女孩子
</div>
</body>
</html>
结果:


浙公网安备 33010602011771号