当前位置: 代码迷 >> HTML/CSS >> CSS如上如何让<h4>标题</h4>顶端对齐
  详细解决方案

CSS如上如何让<h4>标题</h4>顶端对齐

热度:737   发布时间:2012-08-22 09:50:34.0
CSS如下怎么让<h4>标题</h4>顶端对齐?
<body>
<style type="text/css">
<!--
.div_w_984{
width:984px;
border-color:#CCC;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
-->
</style>
<div class="div_w_984" ><h4>标题</h4>
<div class="div1"></div>
<div class="div1"></div>
<div class="div1"></div>
</div>
</body>

------解决方案--------------------
<h4 style='margin:0;padding:0'>标题</h4>
------解决方案--------------------
HTML code

<html>
<head>
<title></title>
<style>
.div_w_984 {width:984px;border:1px solid #ccc; vertical-align:top; height:100px;}
.div_w_984 h4{margin:0; padding:0;}
</style>
</head>
<body>
<div class="div_w_984" ><h4>标题</h4>
<div class="div1"></div>
<div class="div1"></div>
<div class="div1"></div>
</div>
</body>
</html> 
  相关解决方案