Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Menu positioning and hover effect help
Old 06-22-2009, 11:59 AM Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
Hi,

I'm new here and I have recently started my personal project in asp.net. I've prepared a layout in psd, sliced it and now I'm trying to complete it with css.

I'm stuck now... i need a horizontal menu with jpg buttons. Afert mouse on it I want that css will change that image for imghover one and after that when I click and enter that part of side I want that button to be in a hover state so the user can see where he is at the moment.

Right now I've got unordered list with images as buttons..

What next?

I've tried doing it on my own but it drives me crazy when all the positioning goes wrong etc.

Please help

Thanks
GaLaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-22-2009, 12:57 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
Hi,

You might want to read these articles to see how to create the tab effect. It basically is just setting an ID to the body.

http://woork.blogspot.com/2008/03/cl...using-css.html
http://clagnut.com/sandbox/csstabs/

And your other image was to have a background image and on hover have a seperate image load? Well that is called sprites. Try reading some of these articles on sprites

http://www.alistapart.com/articles/sprites/
http://css-tricks.com/css-sprites/

If you have trouble implementing these, please post a link to your website so we can assist you Hope this helps.

Cheers
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D

Last edited by EricReese; 06-22-2009 at 12:58 PM..
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-22-2009, 02:30 PM Re: Menu positioning and hover effect help
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
OR - you could just assign a CLASS on the selected menu item on each page and assign the same rules to that class as you do the hover behavior. Like this:

Code:
<li> <a class="selected" href="#">home</a></li>
then in your CSS, define that "selected" class with the background you want it to have.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 06-22-2009 at 07:49 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-22-2009, 02:41 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
Well yes, just basically make the selector unique for the tab, and it should work I was merely pointing out that in my opinion it is very easy to put an id on the <body> because for index.html you could do <body id="home"> and for contact us, you could do <body id="contact"> and it would be a very easy way to identify what tab is to be activated.

Cheers
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-22-2009, 03:25 PM Re: Menu positioning and hover effect help
Experienced Talker

Posts: 45
Trades: 0
EricReese ... Hi thanks for those links. Can you provide be a best CSS Tutorial site??
__________________

Please login or register to view this content. Registration is FREE
printrobin is offline
Reply With Quote
View Public Profile Visit printrobin's homepage!
 
Old 06-22-2009, 03:41 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
Well it depends. How accomplished are you at CSS. Are you a beginner, not understanding most concepts and properties of CSS? Or intermediate, where you know most properties, but are still learning techniques, and have some trouble debugging layouts?

Cheers
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-22-2009, 07:19 PM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
Thanks guys I wasn't expected that someone will answer so fast I'll try just like you've said and I'll tell you if it works if not I'll paste some code here and maybe with your pro help I can finish my objective thanks again
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-22-2009, 07:25 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
No problem Just so you know, we would prefer a link especially because of the sprites, and the fact it is much easier debugging a live page, and we get to see all the source + the images.

Did you still want a tutorial? Here is one with various CSS levels.

http://htmldog.com

edit: Oh, a different person had asked for the tutorials. I was played!!
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-22-2009, 08:00 PM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
It's weird... hm or I'm doing sth wrong. Check this please:

My html menu (one button)

Code:
 <div id="menu">
        <ul>
            <li id="btnProject"><a href="theProject.aspx"></a>
            </li>
        </ul>
    
    
    </div>
and I want to add a button as a background to <li> so I've added in my style sheet

Code:
 
#btnProject 
 {
    background-image:url('../img/btnProject.jpg');
 }
I've checked the path it's 100% ok... I don't now if that the case but I've already asigned repeated background to all my page...

Thanks for help...
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-22-2009, 08:03 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
We need a link to the website...
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-22-2009, 08:12 PM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
http://meltedheart.pl/ui/shared/


heres site that i'm planning to finish...

anyway betweend those to lines I want to place a horizontal menu using images. Then hover efect with other images.
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-22-2009, 08:24 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
First off, on ul {} set a width like 900px, and put margin:0 auto; on there so there isn't an override on the elft side. This doesn't fix your problem, but makes it easier to see the effects of it.

Now on #btnProject add these values:

background-repeat:no-repeat;
height:55px;

Cheers
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-23-2009, 11:16 AM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
I've done it and it works nice


But now another problem -> how to center the menu? now it looks like this http://meltedheart.pl/ui/shared/

afeter centering I'll try to add a hover affect using another prepared for that reason image and I will also try to create a class for keep a hover image when the users is in a particular web site section.
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-23-2009, 11:20 AM Re: Menu positioning and hover effect help
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Eric already told you how to do that:
Quote:
on ul {} set a width like 900px, and put margin:0 auto;
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-23-2009, 11:57 AM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
Yes I know and I did just like he said. And thats the effect... so sth is still wrong.

I wouldn't be wasting your time otherwise.
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-23-2009, 12:56 PM Re: Menu positioning and hover effect help
EricReese's Avatar
Super Talker

Posts: 137
Name: Eric Reese
Location: Maryland, USA
Trades: 0
First off, for easier editing, apply a class to the <li>'s and instead of <div id="menu"> why not just use the <ul>? There's no difference and it saves some code:

Code:
       <ul id="menu">
        <li id="btnProject" class="something"><a href="theProject.aspx"></a></li>
        <li id="btnHarmonogram" class="something"><a href="harmonogram.aspx"></a></li>
        <li id="btnRejestracja" class="something"><a href="rejestracja.aspx"></a></li>
        <li id="btnZapisani" class="something"><a href="zapisani.aspx"></a></li>

        <li id="btnKontakt" class="something"><a href="kontakt.aspx"></a></li>
        <li id="btnTworca" class="something"><a href="tworca.aspx"></a></li>
       </ul>
Next you need to set a width on the <li>'s and float them like so:

Code:
ul#menu li.something{
    width:150px;
    float:left;
}
Cheers
__________________
I am 17 years old.Looking for Web Design Job(s). If interested use my
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Funny Line- "I'll Twitter your Yahoo! until I Google all over your FaceBook :D
EricReese is offline
Reply With Quote
View Public Profile Visit EricReese's homepage!
 
Old 06-24-2009, 07:01 PM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
Ok I did it "somehow" :| But there is sth wrong, first button is a little bit closer to other hm I've checked button size and it seems ok to me

Another thing is that I have browsed my page in Safari and I was ok, IE nad FF too but in new Opera it was totally mess.

I know that I'm asking too many questions but I'm trying to learn it to me it's the worst part of web developement...

Thanks
GaLaZ is offline
Reply With Quote
View Public Profile
 
Old 06-26-2009, 02:29 PM Re: Menu positioning and hover effect help
Novice Talker

Posts: 13
Name: Sean Lum
Location: Portland, Oregon, USA, Planet Earth
Trades: 0
you should try using reset.css, it may help with some of your problems.
http://meyerweb.com/eric/tools/css/reset/
__________________
I'm 17 years old and looking for work.
web/information/graphic Design/SEO/Re-design

Please login or register to view this content. Registration is FREE

Last edited by Sean Lum Design; 06-26-2009 at 02:38 PM..
Sean Lum Design is offline
Reply With Quote
View Public Profile Visit Sean Lum Design's homepage!
 
Old 06-26-2009, 02:34 PM Re: Menu positioning and hover effect help
Novice Talker

Posts: 13
Name: Sean Lum
Location: Portland, Oregon, USA, Planet Earth
Trades: 0
you should try using reset.css, it may help with some of your problems.
http://meyerweb.com/eric/tools/css/reset/

double post, sorry :\
__________________
I'm 17 years old and looking for work.
web/information/graphic Design/SEO/Re-design

Please login or register to view this content. Registration is FREE

Last edited by Sean Lum Design; 06-26-2009 at 02:39 PM..
Sean Lum Design is offline
Reply With Quote
View Public Profile Visit Sean Lum Design's homepage!
 
Old 06-26-2009, 03:07 PM Re: Menu positioning and hover effect help
Average Talker

Posts: 15
Name: Gregory
Trades: 0
Reseted but no positive result... :| anyway thanks for that template I will start using that in future.

Any ideas? how to fix that?

I hope that I won't be forced to slice that layout once again and start over again
GaLaZ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Menu positioning and hover effect help

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.81489 seconds with 12 queries