I'm currently stuck on problem with my list, it disappears when mouse hovers over other objects like that (used dev console to highlight borders):https://i.stack.imgur.com/fOwld.gif
I could just increase margin-top but it would look unaesthetically.
My question is how can I make it not disappear when mouse hovers over other objects, I actually accomplished it on my other website but I checked code and I have no idea why on this one it works:https://i.stack.imgur.com/ksfUd.gif Here is the navigation css code:
.nav
{
width: 100%;
padding: 10px 0;
background-color: #ffffff;
text-align: center;
white-space: nowrap;
}
ol
{
padding: 0;
margin: 0;
list-style-type: none;
font-size: 18px;
height: 35px;
line-height: 200%;
display: inline-block;
}
ol a
{
text-decoration: none;
color:#50394c;
display: block;
}
ol >li
{
float: left;
padding-left:45px;
padding-right:45px;
opacity: 0.8;
}
ol >li:hover
{
opacity: 1;
}
ol >li >ul
{
display: none;
list-style-type: none;
background-color:#ffffff;
}
ol >li:hover >ul
{
display:block;
padding-left:0px;
padding-top:14px;
}
ol > li > ul > li
{
border-top: 1px dashed #b97070;
text-align:center;
opacity: 0.8;
}
ol > li > ul > li:hover
{
opacity: 1;
}
Here is the headline and img css code:
.pillowheadline
{
width:700px;
display: inline-block;
position: relative;
bottom: 40px;
}
.pillowimg1
{
width:500px;
height:300px;
display: inline-block;
margin-top:120px;
}
html:
<header>
<h1 class="logo">PRZYKŁADOWY TEKST</h1>
<nav id="topnav">
<div class="nav">
<ol>
<li><a href="#">Front page</a></li>
<li><a href="#">Recommended Products</a>
<ul>
<li><a href="#">Pillows</a></li>
<li><a href="#">Honey</a></li>
<li><a href="#">przykład3</a></li>
</ul>
</li>
<li><a href="#">Natural Products</a>
<ul>
<li><a href="#">Cereals</a></li>
<li><a href="#">Wicker</a></li>
<li><a href="#">Fruits</a></li>
<li><a href="#">Dairy</a></li>
<li><a href="#">Herbs</a></li>
</ul>
<li><a href="#">Contact</a></li>
</ol>
</div>
</nav>
</header>