I want to disply the absolute div that overflows from the container.
Here are my requirements:
- fixed div that overflows content.
- overflow-y should be auto to scroll but not overflow-y
- absolute div should be displayed.
- page should not be scroll the only fixed position div should be scroll
And here are the problems I am having:
- on putting overflow property for panel the absolute div is hiding.
- and on remove of overflow property the panel not scrolling.
css
#panel {
position: fixed;
top: 0px;
right: 20%;
bottom: 0px;
background: snow;
}
.contact {
background: skyblue;
position: relative;
height:50px;
}
.std {
width: 80px;
}
.vtl {
position: absolute;
background: red;
display: none;
left:-153px;
margin-top:-35px;
width: 150px;
height: 50px;
}
.vtl:after {
content: ' ';
height: 0;
position: absolute;
width: 0;
border: 10px solid transparent;
border-left-color: red;
left: 100%;
top: 10px;
}
.contact:hover .vtl {
display: block;
}
html
<div id="panel">
<div class="contact">
<div class="std">
Hover me!
</div>
<div class="vtl">
tools
</div>
</div>
<div class="contact">
<div class="std">
Hover me!
</div>
<div class="vtl">
tools
</div>
</div>
<div class="contact">
<div class="std">
Hover me!
</div>
<div class="vtl">
tools
</div>
</div>
......
</div>
Because
<div class="std">is contained within the<div id="panel">which has a fixed position, you will need to expand the width of#panelin order to display the content within the<div class="std">. For example:HTML
CSS
Here’s a working example: http://jsfiddle.net/pZQrA/