dream hunter dream hunter - 3 months ago 7
HTML Question

i want to display the drop down menu without hiding other data

In the code given below when i select the 'apps' drop-down menu,it hide the data below (ie,it's hide 'layout' and 'widjet'). run the given code.i need to show that data with the drop-down effect.can you help me?

<html>
<head>
<title> PROJECT </title>
<link rel="stylesheet" type="text/css" href="stack.css">
</head>
<body>
<div id="first" style="float:left; lngth:60%; ">
<p><img src="image1.jpg" id="boa"><span class="bob">First</span></p>
<p class="boc" >Main</p>
<div id="demo">
<div class="wrapper">
<div class="parent">Dashboard</div>
</div><br> <br>
<div class="wrapper">
<div class="content">
<ul>
<a href="#"><li>Inbox</li></a>
<a href="#"><li>Condact</li></a>
<a href="#"><li>Calender</li></a>
<a href="#"><li>Other</li></a>
</ul>
</div>
<div class="parent">Apps</div>
</div><br><br>

<div class="wrapper">
<div class="content">
<ul>
<a href="#"><li>Header</li></a>
<a href="#"><li>Aside</li></a>
<a href="#"><li>Footer</li></a>
<a href="#"><li>Other</li></a>
</ul>
</div>
<div class="parent">Layouts</div>
</div><br><br>
<div class="wrapper">
<div class="parent">Widjet</div>
</div>
</div>

<p class="boc">Componets</p>

<p class="boc">Help</p>
<p class="bod">&nbsp; Documents</p>

</div>

</body>
</html>


css:

#first {
float:left;
width:15%;
color :bisque;
border-color: #023b3b;
border-style : solid;
height: 100%;
background-color :#023b3b;
}

#boa{
height: 5%;
width: 20%;
float: left;

}

.bob{
text-indent: 200%;
line-height: 210%;
font-size: 150%;
font-family: sans-serif;
color: white;
font-weight: bold;

}
.boc{
text-indent: 4%;
color : white;
font-size: 83%;
font-family: sans-serif;

font-weight: normal;
}
.bod{
color:white;
font-size: 100%;
font-family: sans-serif;
line-height: 200%;
list-style-type: none;
}
#demo {
margin: 30px 0 50px 0;
font-family: sans-serif;
}

#demo .wrapper {
display: inline-block;
width: 180px;
/* margin: 0 10px 0 0;*/
height: 20px;
position: relative;
}

#demo .parent {
height: 100%;
width: 100%;
display: block;
cursor: pointer;
line-height: 30px;
height: 30px;
/* border-radius: 5px;*/
background: #023b3b;
border: 1px solid #023b3b;
border-bottom: 1px solid #023b3b;
color: white;
/* font-weight: bold;*/
z-index: 2;
position: relative;
-webkit-transition: border-radius .1s linear, background .1s linear, z-index 0s linear;
-webkit-transition-delay: .2s;
text-align: center;
}

#demo .parent:hover,
#demo .content:hover ~ .parent {
background: #122112;
-webkit-transition-delay: 0s, 0s, 0s;
}

#demo .content:hover ~ .parent {
/* border-bottom-left-radius: 0;
border-bottom-right-radius: 0;*/
z-index: 0;
}

#demo .content {
position: absolute;
top: 0;
display: block;
z-index: 1;
height: 0;
width: 180px;
padding-top: 30px;
-webkit-transition: height .2s ease;
-webkit-transition-delay: .4s;
border: 1px solid #339933;
/* border-radius: 5px;*/
/*box-shadow: 0 1px 2px rgba(0,0,0,.4);*/
}

#demo .wrapper:active .content {
height: 100px;
z-index: 3;
-webkit-transition-delay: 0s;
}

#demo .content:hover {
height: 123px;
z-index: 3;
-webkit-transition-delay: 0s;
}


#demo .content ul {
background: #339933;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;

}

#demo .content ul a {
text-decoration: none;
}

#demo .content li:hover {
background: #122112;
color: white;
}

#demo .content li {
list-style: none;
text-align: left;
color: white;
font-size: 14px;
line-height: 30px;
height: 30px;
padding-left: 10px;
border-top: 1px solid #023b3b;
}


In the above code when i select the 'apps' drop-down menu,it hide the data below (ie,it's hide 'layout' and 'widjet'). run the given code.i need to show that data with the drop-down effect.can you help me?

Answer

I can give you some important hints. Firstly you want to remove position: absolute from #demo .content selector. Moreover position: relative; into position: absolute; in #demo .parent selector.

This will allow whole menu to expand when it needs to fit more content.