CSS设置背景颜色和边框
夜半钟声2019-01-30 15:34:57340<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
body{margin:0;}
.main{margin:0px auto; width:500px; padding:10px;}
.title{ width:100%;height:50px; line-height:50px; text-align:center; font-size:24px; background-color:#09F; color:#FFF; margin-bottom:5px;}
.title2{ width:100%;height:50px; line-height:50px; text-align:center; font-size:24px; border:1px solid #09F; margin-bottom:5px;}
.title3{ width:100%;height:50px; line-height:50px; text-align:center; font-size:24px; border-bottom:2px solid #09F; margin-bottom:5px;}
</style>
</head>
<body>
<div class="main">
<div class="title">PHP中文网</div>
<div class="title2">PHP中文网</div>
<div class="title3">PHP中文网</div>
</div>
</body>
</html>