qq_一支泊_0
2016-03-26 18:15
<div class="news">
<div class="title"><h2 class="title_left">新闻中心</h2><a href="news.html"><span classs="title_right">More>></span></a></div><!--title结束-->
<div class="pic_news">
<img src="images/news.jpg"/>
<h2>520慕女神喊你来表白!</h2>
<p>活动时间5月20日-5月25日<br/>获奖公布时间:5月26日<br/>Learn More>></p>
</div><!--pic_news结束-->
.news
{
width:340px;
border:1px solid #e8e8e8;
}
.course
{
width:410px;
border:1px solid #e8e8e8;
margin:0 7px;
background-color:#393CCD;
}
.sidebar
{
width:230px;
background-color:#42B57E;
}
.news,.course,.sidebar
{
height:250px;
float:left;
}
.title
{
height:35px;
border-bottom:2px solid #e8e8e8;
}
.title_left
{
width:70%;
font-family:"微软雅黑";
font-size:14px;
font-weight:bold;
color:#786f66;
float:left;
line-height:35px;
padding-left:20px;
}
.title_right
{
width:20%;
float:left;
line-height:35px;
}
				*{margin:0;padding: 0;}
		
	.news
	{
	width:340px;
	border:1px solid #e8e8e8;
	}
	.course
	{
	width:410px;
	border:1px solid #e8e8e8;
	margin:0 7px;
	background-color:#393CCD;
	}
	.sidebar
	{
	width:230px;
	background-color:#42B57E;
	}
	.news,.course,.sidebar
	{
	height:250px;
	float:left;
	}
	.title
	{
	height:35px;
	border-bottom:2px solid #e8e8e8;
	}
	.title a{line-height: 37px;}
	.title_left
	{
	width:70%;
	font-family:"微软雅黑";
	font-size:14px;
	font-weight:bold;
	color:#786f66;
	float:left;
	line-height:35px;
	padding-left:20px;
	}
	.title_right
	{
	width:20%;
	float:left;
	}
	
	一开始把浏览器的margin和padding清除一下,然后你的title>a 标签是内联元素,给它设置ling-height
	就行了。
				太好了  谢谢回答 很给力
				非常感谢!!我也是同样的问题,做在浏览器的第一个DIV总是对不齐,现在解决了
企业网站综合布局实战
157078 学习 · 2157 问题
相似问题