效果如图:
css:
* {
padding: 0;
margin: 0;
list-style-type: none;
}
body {
padding: 20px 0 0 20px;
}
#shadow {
background: #E8E8E8;
position: relative;
width: 250px;
margin: 20px 0 0 5px;
font: 12px/20px Arial;
}
#content {
position: relative;
top: -5px;
left: -5px;
background: #fff;
border: 1px solid #FF44FF;
z-index: 1;
padding: 30px 10px 10px 10px;
}
#title {
width: 238px;
height: 40px;
background: #DDDDDD;
position: absolute;
top: -20px;
left: -5px;
border: 1px solid #FF44FF;
border-width: 1px 1px 0 1px;
z-index: 2;
line-height: 40px;
padding-left: 10px;
}
html:
<div id="shadow">
<div id="title">新闻</div>
<div id="content">
<ul>
<li><a href="#">第1个标题</a></li>
<li><a href="#">第2个标题</a></li>
<li><a href="#">第3个标题</a></li>
<li><a href="#">第4个标题</a></li>
<li><a href="#">第5个标题</a></li>
<li><a href="#">第6个标题</a></li>
<li><a href="#">第7个标题</a></li>
<li><a href="#">第8个标题</a></li>
<li><a href="#">第9个标题</a></li>
<li><a href="#">第10个标题</a></li>
</ul>
</div>
</div>