School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,420 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,527 people online right now. Registration is fast and FREE... Join Now!




So I need some help creating a menu on my website.

 

So I need some help creating a menu on my website.

papuccino1

19 Jun, 2009 - 11:09 AM
Post #1

C# Programmer
Group Icon

Joined: 2 Mar, 2008
Posts: 943



Thanked: 33 times
Dream Kudos: 50
My Contributions
So I'm a super newb to HTML layouts in general and I want to create an html menu on my site:

http://www.papuccino1.iflintinternet.co.uk/


Can anyone share a VERY simple example of how to position a normal looking top menu for a website?

I'm familiar with HTML and CSS (to a certain degree) but I can't make anything unless I see an example of what can be done.

Thanks. smile.gif

User is offlineProfile CardPM
+Quote Post


papuccino1

RE: So I Need Some Help Creating A Menu On My Website.

19 Jun, 2009 - 11:19 AM
Post #2

C# Programmer
Group Icon

Joined: 2 Mar, 2008
Posts: 943



Thanked: 33 times
Dream Kudos: 50
My Contributions
Found this tutorial but it uses iFrames:
http://www.bookchamp.net/Creating-a-Menu.asp

Ewwwww.....


There has to be a better way that doesn't involve frames.
User is offlineProfile CardPM
+Quote Post

crazyjugglerdrummer

RE: So I Need Some Help Creating A Menu On My Website.

19 Jun, 2009 - 12:13 PM
Post #3

YOUR AD HERE
Group Icon

Joined: 7 Jan, 2009
Posts: 677



Thanked: 94 times
Dream Kudos: 425
My Contributions
So you want to position a menu? Look into CSS positioning, with the float, position, right, top, and many other properties. It definitely can be done. biggrin.gif
User is offlineProfile CardPM
+Quote Post

gregwhitworth

RE: So I Need Some Help Creating A Menu On My Website.

19 Jun, 2009 - 12:23 PM
Post #4

(this).problem + "sucks";
Group Icon

Joined: 20 Jan, 2009
Posts: 1,131



Thanked: 82 times
Dream Kudos: 50
Expert In: HTML, CSS, Web Design

My Contributions
Menus are just unordered lists - here's a great tut:

http://www.alistapart.com/articles/taminglists/
User is offlineProfile CardPM
+Quote Post

Ryanmiller

RE: So I Need Some Help Creating A Menu On My Website.

21 Jun, 2009 - 12:48 AM
Post #5

New D.I.C Head
*

Joined: 20 Jun, 2009
Posts: 16


My Contributions
Well to start off, always use divs to format your template, never tables.

A basic website with an along the top menu would be something like:

<div id="header">
<div id="menu">
<a href="home.php"><img src="home_button.jpg" /></a>
<a href="aboutus.php"><img src="aboutus_button.jpg" /></a>
<a href="contactus.php"><img src="contact_button.jpg" /></a>
<a href="faq.php"><img src="faq_button.jpg" /></a>
</div>
</div>

And then on the CSS page that you're linking to, it would look something like this:

#header
{
width: 800px;
height: 300px;
background-image: url(images/header_bg.jpg);
background-repeat: no-repeat;
text-align: center;
}

#menu
{
width: 800px;
height: 50px;
position: relative;
top: 250px;
text-align: center;
background-image: url(menu_bg.gif);
background-repeat: repeat-x;
}

This basically places a menu bar inside of the header. The header is 300px tall, and the menu is 50px tall. With position: relative, we tell the browser that we're about to move the menu away from the position where it's supposed to be (at the very top of the header div). So then, we go ahead and put top: 250px, which makes it so the TOP of the menu div is 250px below where it's supposed to be, making the bottom of the menu line up perfectly with the bottom of the header.

Then, with the text-align: center; we just center the menu buttons (home, contact us, about us, faq) etc.

Hope this helps.


If you want to see an in depth example, I made a website a while ago that used this basic format.

http://www.conejofamilydentist.com

and the style sheet is http://www.conejofamilydentist.com/style.css

This post has been edited by Ryanmiller: 21 Jun, 2009 - 12:50 AM
User is offlineProfile CardPM
+Quote Post

papuccino1

RE: So I Need Some Help Creating A Menu On My Website.

2 Jul, 2009 - 02:59 PM
Post #6

C# Programmer
Group Icon

Joined: 2 Mar, 2008
Posts: 943



Thanked: 33 times
Dream Kudos: 50
My Contributions
Ryan, could you please post what's inside the home.php and aboutus.php files? I don't understand how the site is actually loading the appropriate content. :S T_T
User is offlineProfile CardPM
+Quote Post

Ryanmiller

RE: So I Need Some Help Creating A Menu On My Website.

3 Jul, 2009 - 01:01 PM
Post #7

New D.I.C Head
*

Joined: 20 Jun, 2009
Posts: 16


My Contributions
QUOTE(papuccino1 @ 2 Jul, 2009 - 02:59 PM) *

Ryan, could you please post what's inside the home.php and aboutus.php files? I don't understand how the site is actually loading the appropriate content. :S T_T



Those are just the files or web pages I' linking to on the header. They don't have to be home.php or aboutus.php, they could easily be yahoo.com or http://www.dreamincode.net/forums/index.ph...amp;qpid=691807

QUOTE(Ryanmiller @ 3 Jul, 2009 - 12:56 PM) *

QUOTE(papuccino1 @ 2 Jul, 2009 - 02:59 PM) *

Ryan, could you please post what's inside the home.php and aboutus.php files? I don't understand how the site is actually loading the appropriate content. :S T_T



Those are just the files or web pages I' linking to on the menu. They don't have to be home.php or aboutus.php, they could easily be yahoo.com or http://www.dreamincode.net/forums/index.ph...amp;qpid=691807



Sorry I didn't understand what you were asking. But if the index.php and aboutus.php files are in the same web folder as the page that is linking to them, then you don't need to put "http://www.yourwebsite.com/aboutus.php"

you only need to put aboutus.php and then the broswer automatically fixes it
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 12:08AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month