日期:2014-05-17  浏览次数:20620 次

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>