Jump to content

Menus using divs


LittleNicky

Recommended Posts

Ok so I've finally admitted divs seem to be the way forward where data is not stored.So whats the best way to create a menu using divs? A menu that has each link on top of each other but nicely spaced. Each menu item background must be the same length!

Link to comment
Share on other sites

Hi,Check this out:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head><title>Menu</title>	<meta name="Author" content="Chandra Vedantham">	<meta name="Description" content="Html Page">	<style>		*,body		{			 background-color: "#FFFFF2";			 margin-left: 0px;			 font-family: "Tahoma";			 font-size: 11;			 color: Navy;			 margin-top: 0;			 margin-bottom: 0;			 margin-right: 0;		}		div.menucontainer		{			 background-color: "#990000";			 margin-left: 0px;			 padding-left: 2px;			 width:200px;			 height:100%;			 font-family: "Tahoma";			 font-size: 11;			 color: Navy;			 margin-top: 0;			 margin-bottom: 0;			 margin-right: 0;		}		.menuitem		{			margin-left: 10px; 		  margin-top: 1px;			margin-bottom: 1px;			margin-right: 1px;			background-color: transparent;			color: "#FFFFF2";			font-weight: bold;		}		.menuitem a		{			background-color: transparent;			color: "#FFFFF2";			font-weight: bold;			display: block;		}	</style></head><body>	<div class="menucontainer">		<div class="menuitem">			<a href="#"> Chandu </a>			<div class="menuitem">				<a href="#"> Sandeep </a>				<a href="#"> Arnab </a>				<a href="#"> Rigdhi </a>				<a href="#"> Imran </a>			</div>		</div>		<br/>		<span class="menuitem">Another menu: </span><br/>		<ul class="menuitem">			<li class="menuitem">				Chandu				<ul class="menuitem">					<li class="menuitem">Sandeep</li>					<li class="menuitem">Arnab</li>					<li class="menuitem">Rigdhi</li>					<li class="menuitem">Imran</li>				</ul>			</li>		</ul>	</div></body></html>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...