CSS Menu

This is a discussion on "CSS Menu" within the Web Page Design section. This forum, and the thread "CSS Menu are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 24th, 2007, 23:49
New Member
Join Date: Aug 2007
Location: NC
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
CSS Menu

Ok so I have a problem. I am looking for a horizontal menu with a fixed height of about 60px, where the text is at the bottom of the division and the rollover background takes up the whole height of the div. An example of the type of menu I am looking for is the one at Griffin Web Design. If anyone could help me I would greatly appreciate it!
Reply With Quote

  #2 (permalink)  
Old Oct 25th, 2007, 01:36
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Menu

Alright. I took a look at the stylesheet. Here is what I found:
Code: Select all
/*------------------------------------------------------------------------------- Navigation----- */

a {
    color: #660000;
}

a:hover {
    text-decoration: none;
}

#nav_strip {
    height: 100px;
    width: 800px;
    margin-right: auto;
    margin-left: auto;
}

#global_nav {
    height: 100px;
    width: 500px;
    margin-right: auto;
    margin-left: auto;
    float: left;
}

#logo_box {
    height: 78px;
    width: 63px;
    margin-right: auto;
    margin-left: auto;
}

.hide {
    display: none;
}

.logo a {
    background-image:url(../i/topLogo.gif);
    width:150px;
    height:100px;
    float:left;
    background-repeat:no-repeat;
}

.home a {
    background-image: url(../i/home.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.services a {
    background-image: url(../i/services.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.portfolio a {
    background-image: url(../i/folio.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.about a {
    background-image: url(../i/about.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.contact a {
    background-image: url(../i/contact.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.fbanner a {
    background-image: url(../i/footerbanner.gif);
    background-repeat: no-repeat;
    float: left;
    height: 150px;
    width: 400px;
}

.logo a:hover {
    background-position:right;
}

.home a:hover {
    background-position: right;
}

.services a:hover {
    background-position: right;
}

.portfolio a:hover {
    background-position: right;
}

.contact a:hover {
    background-position: right;
}

.about a:hover {
    background-position: right;
}


.banner_info a:hover {
    background-position: right;
}

.fbanner a:hover {
    background-position: right;
}

.home_active a {
    background-image: url(../i/homeActive.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.services_active a {
    background-image: url(../i/servicesActive.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}


.contact_active a {
    background-image: url(../i/contactActive.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.about_active a {
    background-image: url(../i/aboutActive.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}

.portfolio_active a {
    background-image: url(../i/portfolioActive.gif);
    background-repeat: no-repeat;
    float: left;
    height: 100px;
    width: 100px;
}
#about_left {
    float: left;
    width: 25%;
}
#about_right {
    float: right;
    width: 73%;
}
This might seem intensely difficult, but it really is not so scary. The idea is that the text that is at the bottom of the div, is actually at the bottom of a background image. This means, it is not physical text on the page. When the mouse is hovered over a navigation div, the background image simply changes position. Take a look at one of those images:

The first half is the original :: it is positioned left so that only that half is being displayed. The second half is the :hover class :: this appears when the mouse rolls over the div, changing the background position to right. In other words, the background image is moved around according to the position of the mouse. Am I making sense? Try looking through the CSS a bit, and see if you can figure it out. However, I would be glad to assist you further .

Cheers,
SWagner
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)

Last edited by Stuart; Oct 25th, 2007 at 01:48.
Reply With Quote
  #3 (permalink)  
Old Oct 25th, 2007, 02:00
New Member
Join Date: Aug 2007
Location: NC
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Menu

So do you think I could do this an easier way with lists or is that the best way?

I think I understand what you are saying but as far as photoshop or fireworks go, I can make images but I do not know how to slice them or make them into buttons.

Last edited by defy; Oct 25th, 2007 at 02:03.
Reply With Quote
  #4 (permalink)  
Old Oct 25th, 2007, 03:27
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: CSS Menu

I have another easy example on this hover button, all you have to do is set a div width to the size of the button that you want to create. In this example, the width of the button is 157px.

as you see, the "menu a", is set to "0" "0" so that it will display the left most image, in this example, it's the yellow color button.

when you hover the link, it will shift the image so that it will display the center image, and so on..

Here is the CSS:
Code: Select all
#menu a {
   background: url("button.gif") 0 0 no-repeat;
   ...
   }
#menu a:hover {
   background-position: -157px 0;
   ...
   }
#menu a:active {
   background-position: -314px 0;
   ...
   }
Here is the working example, hope that helps.
Attached Images
File Type: gif button.gif (751 Bytes, 14 views)
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #5 (permalink)  
Old Oct 25th, 2007, 11:36
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Menu

Quote:
Originally Posted by defy View Post
I can make images but I do not know how to slice them or make them into buttons.
This is not necessary. Monie explained it pretty well (I guess I wasn't being clear enough ). All you have to do is create an image that contains the normal state, the hover state, and (optional) the active state. You do not have to make actual buttons, it's just a background image changing position.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Reply With Quote
  #6 (permalink)  
Old Oct 25th, 2007, 12:27
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Menu

Another point is that you don't NEED images. If all you want is to change the background color, then just use CSS.

If you have a look at my portfolio, my menu doesn't use images at all. All css
Reply With Quote
  #7 (permalink)  
Old Oct 25th, 2007, 12:51
Up'n'Coming Member
Join Date: Oct 2007
Location: Darlington
Age: 23
Posts: 76
Thanks: 0
Thanked 1 Time in 1 Post
Re: CSS Menu

Hi defy,

If you have any trouble setting up your navigation just give us a holla and I'll help you along the way. I think this is the best way to go with navigation when you change position rather than use a different image on hover because you get to lag/wait for the new image to appear.

Regards Andy

www.griffinwebdesign.co.uk
Reply With Quote
  #8 (permalink)  
Old Oct 26th, 2007, 08:37
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Menu

You might find this site helpful it has lots of examples of different menu styles

http://css.maxdesign.com.au/listamatic/

I find it very useful
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
css menu csun PHP Forum 4 Aug 1st, 2007 20:37
I have a normal css menu, but want ot add drop down menu to it multichild Web Page Design 7 Jan 9th, 2007 16:07
Add Sub Menu DannyP43 JavaScript Forum 10 Sep 3rd, 2006 19:47
CSS menu cbrams9 Web Page Design 1 Aug 3rd, 2006 15:46
Help with pop-up menu please!!!?? aseriouslyfunkydiva Graphics and 3D 1 Nov 16th, 2005 15:11


All times are GMT. The time now is 13:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43