I am trying to create a navigation bar that displays a big block when hovered over, but unfortunately, it's not working as expected.
Below is the HTML code I have written:
<div id="outerContainer">
<div id="header">
<a id="logo" href="#"><img src="#"></a>
<div id="nav">
<div class="selectors"><a href="#">aaa</a></div>
<div class="selectors"><a href="#">bbb</a></div>
<div class="selectors"><a href="#">ccc</a></div>
<div class="selectors"><a href="#">ddd</a></div>
</div>
</div>
<div id="innerContainer">
<div class="navHidden"></div>
<div class="navHidden"></div>
<div class="navHidden"></div>
<div class="navHidden"></div>
<div id="content"></div>
</div>
Here is the CSS code I have used:
#nav{
position:relative;
float:left;
width:600px;
padding-left:30px;
padding-top:25px;
}
.selectors{
width:150px;
position:relative;
float:left;
margin:0;
z-index:10px;
}
.selectors:hover{border-bottom-color:silver;background-color:silver;}
.navHidden{
width:760px;
height:100px;
background-color:silver;
position:absolute;
z-index:10;
display:none;
visibility:hidden;
}
The desired layout of the website should look like this:
|.selectors |.selectors | .selectors | .selectors |
| navHidden .....(only shown when hover)......|
Due to assignment restrictions, I am only allowed to use HTML and CSS for this project.
Thank you.