CSS positioning simulation projection, height can vary with content

Source: Internet
Author: User

Effect

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" > News </div>
<div id= "Content" >
<ul>
<li><a href= "#" > 1th title </a></li>
<li><a href= "#" > 2nd title </a></li>
<li><a href= "#" > 3rd title </a></li>
<li><a href= "#" > 4th title </a></li>
<li><a href= "#" > 5th title </a></li>
<li><a href= "#" > 6th title </a></li>
<li><a href= "#" > 7th title </a></li>
<li><a href= "#" > 8th title </a></li>
<li><a href= "#" > 9th title </a></li>
<li><a href= "#" > 10th title </a></li>
</ul>
</div>
</div>

CSS positioning simulation projection, height can vary with content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.