I just started learning html and css, and i have a problem with this menu.
When you hover on an element it should higlight it by expanding padding and changing the border color (in the code this is made in a strange way but it because initially it was meant to have a caption written in the "li" ) but when you hover on an element other 4 element go down for some reason.
I already tried to messing around with margin, paddings and position
nav #MotherList{
list-style-type:none;
margin:0px;
padding:0px;
text-align:center;
}
li.navoptions {
width:103px;
height:93px;
padding:0px;
border-radius:4px;
margin-left:5px;
margin-right:5px;
position:relative;
top:4px;
color:black;
text-align:center;
background-color:red;
display:inline-block;
}
.navoptions:hover{
background-color:white;
padding:2px;
position:relative;
top:2px;
margin-left: 3px;
margin-right: 3px;
}
.navoptions div {
width:100px;
height:90px;
border-radius:4px;
margin-left:auto;
margin-right:auto;
position: relative;
top:1.5px;
background-color:yellow;
background-size:100px 90px;
background-repeat: no-repeat;
text-indent: -999999px;
}
#nav1{
background-image:url("../images/nav1.png");
}
#nav2{
background-image:url("../images/nav2.png");
}
#nav3{
background-image:url("../images/nav3.png");
}
#nav4{
background-image:url("../images/nav4.png");
}
#nav5{
background-image:url("../images/nav5.png");
}
<header>
<ul class="MainList">
<li class="MainListMember"><a href="">Home</a></li>
<li class="MainListMember"><a href="">Products</a></li>
<li class="MainListMember" id="Dave" onclick="window.location.href='td.html'"><a href="td.html">Logo</a></li> <!-- Broken <a href> -->
<li class="MainListMember"><a href="">Contacts</a></li>
<li class="MainListMember"><a href="">Infos</a></li>
</ul>
</header>
<nav>
<ul id="MotherList">
<li class="navoptions"><div id="nav1">opt 1</div></li>
<li class="navoptions"><div id="nav2">opt 2</div></li>
<li class="navoptions"><div id="nav3">opt 3</div></li>
<li class="navoptions"><div id="nav4">opt 4</div></li>
<li class="navoptions"><div id="nav5">opt 5</div></li>
</ul>
</nav>
A copy of the project: http://www.mediafire.com/file/blgdejll656uy8y/test_project.rar/file
there are comments in there, some may be wrong