Web Design Forum: code for menu bar - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

code for menu bar

#1 User is offline   leaaa 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 58
  • Joined: 14-March 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 14 April 2009 - 04:01 PM

Hi

this is what I have done so far, for my website.

Visit My Website

I'm at the point now where I have created a small photoshop image for a menu bar, but im not sure how I would get this up, with links on it.

Am i on the wrong lines with this...

#submenu 
{
background: url(/images/navbar.jpg);
height: 29px;
width: 618.6pm;

}


Nothing comes up with it, so must be wrong!

Thanks
0

#2 User is offline   pat24 

  • Guru of nothing important!!
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,183
  • Joined: 29-April 08
  • Reputation: 131
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 14 April 2009 - 04:14 PM

Try this

#submenu {background:transparent url(images/navbar.jpg) repeat scroll 0 0;height:29px;width:100%;}


Dont forget to add the div to your html

Pat
0

#3 User is offline   leaaa 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 58
  • Joined: 14-March 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 14 April 2009 - 04:36 PM

hey, it worked, but its made my content area disappear hehe... im sure i will sort it out, thanks for your help :) x
0

#4 User is offline   pat24 

  • Guru of nothing important!!
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,183
  • Joined: 29-April 08
  • Reputation: 131
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 14 April 2009 - 04:45 PM

View Postleaaa, on Apr 14 2009, 17:36, said:

hey, it worked, but its made my content area disappear hehe... im sure i will sort it out, thanks for your help :) x


Make sure you close the submenu div in the right place as below

<h1>Student Central</h1>
   </div>
   
   <div id="submenu">
	   <div id="menuh">
		 
		   <a href="http://www.numyspace.co.uk/%7Eunn_t005763/" class="top_parent">  Homepage</a>
	   
		 </div></div>
   
   <div id="leftnav">

0

#5 User is offline   leaaa 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 58
  • Joined: 14-March 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 14 April 2009 - 04:55 PM

thanks it works well :)

I didnt realise that i'd have to have to tag <div id="menuh"> thats strange i dont have anything in my CSS called menuh, but nevertheless, it works! thanks! x
0

#6 User is offline   mr p 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 325
  • Joined: 09-December 08
  • Reputation: 6
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 14 April 2009 - 06:03 PM

View Postleaaa, on Apr 14 2009, 17:55, said:

thanks it works well :)

I didnt realise that i'd have to have to tag <div id="menuh"> thats strange i dont have anything in my CSS called menuh, but nevertheless, it works! thanks! x



Hi Leaaa, you don't need #menuh, you only need your #submenu. Especially if you're not even styling #menuh.
0

#7 User is offline   peterpearson 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 01-April 09
  • Reputation: 0
  • Location:London, UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 14 April 2009 - 08:44 PM

Hey,

Assuming there is to be more than more link in this menu it would make sense to use an unordered list, thereby doing away with both menu divs. The submenu id can be applied directly to the <ul> element.

  
   <ul id="submenu">
	  
		<li>
		   <a href="http://www.numyspace.co.uk/%7Eunn_t005763/" class="top_parent">Homepage</a>
		</li>
		
		<li>
		   <a href="#" class="top_parent">Another Link</a>
		</li>

		<li>
		   <a href="#" class="top_parent">Yet another Link</a>
		</li>

   </ul>


Your CSS would then be something along the lines of:


#submenu {
background:transparent url(images/navbar.jpg) repeat-x;
height:29px;
width:100%;
list-style: none;
}

#submenu li{
width: 100px;
float: left;
}


I've not checked this so there may be issues, but this is much better way to build a menu.

Theres more at http://www.webcredible.co.uk/user-friendly...tion-menu.shtml

Shout if you have any problems.
0

#8 User is offline   leaaa 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 58
  • Joined: 14-March 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 14 April 2009 - 10:27 PM

thanks for this, its all coming together now, slowly but surely lol x
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users