I made a simple menu using css and a tutorial on youtube and now I would like to change px into percentages. I have managed to do most of it, but when I go to products, insted of them being listed under each other 4 of them are beside eachother and then 2 of them are underneath. like so
Main menu
|1|2|3|4|
|5|6|
Here is my css code for the menu
/* Menu Starting*/
#navMenu {
margin: 0;
padding: 0;
width: 100%;
}
#navMenu ul {
margin: 0;
padding: 0;
height: 30px;
}
#navMenu li {
margin: 0;
padding: 0;
list-style: none;
float: left;
position: relative;
background-color: gray;
}
#navMenu ul li {
width: 25%;
}
#navMenu ul li a{
text-align:center;
height: 30px;
width: 100%;
display:block;
color:#000;
font-family:"Arial", cursive;
text-decoration:none;
color: white;
border:1px solid black;
}
#navMenu ul ul {
position: absolute;
visibility: hidden;
top: 32px;
}
#navMenu ul li:hover ul {
visibility: visible;
width: 400%; /*Makes it so that the item takes up as large of a space as the main products area*/
}
/*Change color on hover*/
#navMenu a:hover {
background: purple;
}
#navMenu li:hover {
color: white;
background-color: blue;
}
/* hover for link items */
#navMenu ul li:hover ul li a:hover {
color: white;
background-color: red;
}
.clearFloat {
clear:both;
margin: 0;
padding:0;
}
/*end of menu*/
and here is the code for the items
<div id="navMenu" align="center">
<ul> <!-- main ul -->
<li><a href="index.html">Főoldal</a></li>
<li><a href="products.html">Termékek</a>
<ul>
<li><a href="">Faáruk</a></li>
<li><a href="">Csavarok</a></li>
<li><a href="">Ragasztók</a></li>
<li><a href="">Szerszámok</a></li>
<li><a href="">Electromos Alkatrész</a></li>
<li><a href="">Egyéb</a></li>
</ul>
</li> <!-- end of products -->
<li><a href="about.html">Rólunk</a></li> <!-- end of about -->
<li><a href="about.html">Elérhetőség</a></li> <!-- end of contact -->
</ul> <!-- end main ul -->
</div> <!-- end of Menu divider -->
How could I fix this issue?
Thanks for any help