BurebistaRuler
BurebistaRuler

Reputation: 6519

DropDown Menu won't to display on hover

Hello guys I have this drop down menu:

<ul id="menu">
<li class="dropDown"><a>DropDown</a>
   <div id="container">
       <div class="col1">
          <h3 class="has3">CheckOn</h3>
          <ul>
            <li><a href="#">Link1</a></li>
            <li><a href="#">Link2</a></li>
            <li><a href="#">Link3</a></li>
            <li><a href="#">Link4</a></li>
          </ul></div>
        <div class="col1">
         <h3 class="has3">MasterLink</h3>
        <ul>
            <li><a href="#">Link5</a></li>
            <li><a href="#">Link6</a></li>
            <li><a href="#">Link7</a></li>
            <li><a href="#">Link8</a></li>
        </ul></div>

    <div class="col1">
                    <h3 class="has3">MasterLink</h3>
        <ul>
            <li><a href="#">link9</a></li>
            <li><a href="#">link10</a></li>
            <li><a href="#">link11</a></li>
            <li><a href="#">link12</a></li>
        </ul></div>

    <div class="col1">
                    <h3 class="has3">MasterLink</h3>
        <ul>
            <li><a href="#">link13</a></li>
            <li><a href="#">link14</a></li>
            <li><a href="#">link15</a></li>
            <li><a href="#">link16</a></li>
        </ul></div>
</div>
</li>
</ul>

with this css:

#menu{background:#9c7d9e; padding:10px;}

#container{
    width: 550px;
    height: 150;
    border: 1px solid #c5a0b7;
    margin: 0 auto;
    display:none;
}

#mainContainer.dropDown:hover ul{
  display: block;
}

.col1{
float:left;
    margin:5px 20px 0px 20px;
    border-right:1px solid #eaeaea;
}

h3{
width:50px;
border-bottom:1px solid #ccc;
margin-bottom:5px;
  }

a{
text-decoration:none;
padding:5px 0;
}

Is not an ordinal menu because instead of hidden ul, I use a div with other divs inside that contain uls but the behavior should be the same when cursor pass over main li from menu should display container div

I dont want to change html structure because I need the menu to be designed exactly how it is.

fiddle: http://jsfiddle.net

Upvotes: 2

Views: 380

Answers (3)

intelis
intelis

Reputation: 8058

Replace .col1 with div..

http://jsfiddle.net/8SEma/

Upvotes: 3

besluitloos
besluitloos

Reputation: 269

You're addressing the wrong element after :hover. http://jsfiddle.net/RwtHn/1419/

using a div inside an li is frowned upon.

Upvotes: 5

PaperThick
PaperThick

Reputation: 2799

You have to change the #container to block instead

http://jsfiddle.net/RwtHn/1416/

Upvotes: 7

Related Questions