码迷,mamicode.com
首页 > 其他好文 > 详细

DIV上下居中

时间:2017-05-23 22:43:47      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:XML   css   xhtml 1.0   xmlns   span   blog   oct   back   ack   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<style type="text/css">
<!--设置DIV块的边界为5px-->
div{margin:5px;border:0;padding:0;}
#Box1{
    width:200px;
    height:72px;
    background-color:#666;
}
#Box2{
    width:200px;
    height:72px;
    background-color:#F0F;
}
</style>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>让上下两个DIV块之间有一定距离或没有距离</title>
</head>

<body>
<div id="Box1"></div>
<div id="Box2"></div>
</body>

</html>

 

DIV上下居中

标签:XML   css   xhtml 1.0   xmlns   span   blog   oct   back   ack   

原文地址:http://www.cnblogs.com/smartkeke/p/6896409.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!