Jump to content

css drop down menu


afallingpanda

Recommended Posts

<table cellspacing=0 cellpadding=0 class="headertable">
<tr>
<td  class="navbar"><a href="index.php">Home</a></td>
<td  class="navbar"><ul class="drophead">
<li><a href="">Businesses</a></li>
<ul>
<?php
 
$myquery = sql_query("SELECT objectid, object_title FROM webmanage_objects WHERE parentid=6226 AND archived=0 AND is_visible=1 AND object_type='Organisation' ORDER BY object_title");
 
while ($myrow = sql_fetch_assoc($myquery)) { 
print"<li class=\"dropdown\">";
 
transfer_row($myrow);
print "<a href=\"../businesses.php?id=$row_objectid\">$row_object_title</a>";
 
print"</li>";
}
print"</td>";
?>
 
<td  class="navbar"><a href="gallery.php">Gallery</a></td>
<td  class="navbar"><a href="contact_us.php">Contact Us</a></td>
</tr>
 
</table>
</div>

 

 

thats my code for the navbar, and heres the code for the css dropdown that i have created:

 

.drophead { 
    position: relative;
    top: 0px;
    left: 0px;
}


.drophead ul { 
    position: absolute;
    top:17px;
    width:200px;
    display: none;
    border:1px solid #0B3B0B;
    background-color:#B4C4B0;
    text-align:left;
}


.drophead ul li a{
    display:block;
    border-top:1px solid #8C9A89;
}


.drophead ul li a:hover{
    border-bottom:none;
    background-color:#A5C39E;
    padding-bottom:0px;
}


.drophead:hover ul { 
    display: block;
}

i was wondering if someone could tell me how to add a cool transition to it, so the list shows with some animation.

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/283916-css-drop-down-menu/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.