Why does adding overflow-x
to the header
cause the dropdown item to get "cut-off"?
header {
position: fixed;
width: 100%;
background-color: #336699;
overflow-x: hidden;
}
header li {
display: inline-block;
position: relative;
}
header li:hover .previewImg {
display: block;
}
header .previewImg {
position: absolute;
display: none;
}
header a {
display: block;
padding: 10px;
background-color: #ccc;
}
.previewImg {
height: 100px;
width: 75px;
background: orange;
z-index: 999;
}
<header>
<ul>
<li>
<a href="#">Menu Option</a>
<div class="previewImg">Preview Image Here</div>
</li>
<li>
<a href="#">Menu Option</a>
<div class="previewImg">Preview Image Here</div>
</li>
</ul>
</header>
I need the overflow-x
attribute as this dropdown will be included in a DIV which fills the gap between two floated DIVs.
I've searched SO and Googled most of the afternoon and am yet to find a solution. The desired result.