Images in navi

This is a discussion on "Images in navi" within the Web Page Design section. This forum, and the thread "Images in navi 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 Dec 9th, 2006, 18:29
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Question Images in navi

Hi Guys!

I have a question. I know how to do the rollover in navigation, but now i would like to use images instead of letters.
I have this 2 images the darker one is for the link, and the white one is when you hover over the link. I just cant make it work.
Can you guys please help me!

Thank you in advance!
Attached Images
File Type: png navihome.png (36.2 KB, 62 views)
File Type: png hoverhome.png (35.5 KB, 56 views)
Reply With Quote

  #2 (permalink)  
Old Dec 9th, 2006, 19:20
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dapandyman
Re: Images in navi

if the home tab was 'home.gif' and the dimensions 100x30, the code (i think) would go summat lyk this:
The HTML:
Code: Select all
<div class="rollover"> 
         <li>
           <a href="home.html"><img src="home.gif"        width="100" height="30" border="0"></a>        
         </li>
      </div>
The CSS:
Code: Select all
 
<style type="text/css">

.rollover a { display:block; width:32px; background-color: #FFFFFF}
.rollover a:hover { img: url(home2.gif)}
#nav-menu ul
{
list-style: none;
padding: 0;
margin: 0;
}

</style>
I AM A BIT OF A NOOB,
so this may not work.

Last edited by Dapandyman; Dec 9th, 2006 at 19:53.
Reply With Quote
  #3 (permalink)  
Old Dec 9th, 2006, 20:43
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

I tried it but no success, but thank you anyway.
Reply With Quote
  #4 (permalink)  
Old Dec 9th, 2006, 20:50
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

Use the background switch method. Combine those two images so one is above the other.

Code: Select all
<a href="/" title="home" id="home">Home</a>
Code: Select all
a#home {
    width: 100px;
    height: 20px;
    text-indent: -5000px;
    background: #fff url("home.gif") no-repeat 0 0;
    display: block;
}
a#home:hover {
    background-position: 0 100%;
}
I can't remember if text-indent works inside <a> tags. If it doesn't, just apply text-indent: -5000 px; to the <ul> that the links are in.
Reply With Quote
  #5 (permalink)  
Old Dec 9th, 2006, 20:52
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dapandyman
Re: Images in navi

i told you i was a noob... lol
Reply With Quote
  #6 (permalink)  
Old Dec 9th, 2006, 20:56
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

You had the general idea, but the background switch method is better because it only loads one image so there is no flicker or need to preload.
Reply With Quote
  #7 (permalink)  
Old Dec 9th, 2006, 21:05
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

I will try it now.
...other q may sound stoopid : does it matter if i use class or id? and should i use gif instead of png?
Reply With Quote
  #8 (permalink)  
Old Dec 9th, 2006, 21:11
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

No, it doesn't really matter whether you use an ID or a class. ID's are good for anchors and JavaScript. Classes are actually more widely supported.
Reply With Quote
  #9 (permalink)  
Old Dec 9th, 2006, 21:54
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

I tried it but it still not working....
Reply With Quote
  #10 (permalink)  
Old Dec 9th, 2006, 22:08
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

http://ryanfait.com/css/
Reply With Quote
  #11 (permalink)  
Old Dec 10th, 2006, 01:55
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Images in navi

Post the page up here, and we can trouble shoot, and see what you did wrong in the code...lol
Reply With Quote
  #12 (permalink)  
Old Dec 10th, 2006, 08:02
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

The link I gave you is an example in case you missed it for some reason
Reply With Quote
  #13 (permalink)  
Old Dec 10th, 2006, 09:43
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

I tried to modify the link you gave me Ryan, but i have no luck. Anyway, here is the link. http://www.flowerinstyle.co.uk/try.html.
As you see i have those images as navi buttons but i would like to have the white ones when hover.
Reply With Quote
  #14 (permalink)  
Old Dec 10th, 2006, 11:51
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Antwan
Re: Images in navi

Ryan I was wondering if you could explain that example to me, or listen to mine and then fill in the blanks, just hitting a wall whenever I get to a certain point!

Ok, so in the HTML you've set up your list items with links in them, named them appropriately and so on, and you've also given them text values of Home. Now in the CSS you've specified that any link in a list item will be indented off the page, so does that mean the the Text link in the link is wayyy off the page? You also specified that the background for each class is the appropriate gifs so does that mean, that only the gif will be seen, as the text is off-screen? I don't understand the hover part so perhaps you could explain that to me?

Thanks in advance,

Antwan

Last edited by Antwan; Dec 10th, 2006 at 11:53. Reason: Hit the enter button instead of space : )
Reply With Quote
  #15 (permalink)  
Old Dec 10th, 2006, 14:58
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

Ok! I have manage to do it! Here is the link http://www.flowerinstyle.co.uk/try.html
Thank you guys!
My other question is: how can i make the navigation, that Home will be the first and than galery and contact us?
Thank you 4 ur help!

Last edited by chubbs; Dec 10th, 2006 at 15:21.
Reply With Quote
  #16 (permalink)  
Old Dec 10th, 2006, 15:00
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dapandyman
Re: Images in navi

yeah, the swapping's very smooth
Reply With Quote
  #17 (permalink)  
Old Dec 10th, 2006, 16:39
New Member
Join Date: Dec 2006
Location: Louisville, Kentucky
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

Hi Chubbs,

The technique you're going after is tricky depending upon your doc-type. What I can do is recreate what I use on my websites.

Give me tomorrow and I'll post.
Reply With Quote
  #18 (permalink)  
Old Dec 10th, 2006, 16:57
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

I've done it already check the link above...
But thank you !
Reply With Quote
  #19 (permalink)  
Old Dec 10th, 2006, 17:07
New Member
Join Date: Dec 2006
Location: Louisville, Kentucky
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Images in navi

Hey Chubbs,

I noticed you did get it "functioning" but; There is a cleaner way of doing it. To keep the XHTML and CSS clean as intended by its' purpose of separating content and design.
Reply With Quote
  #20 (permalink)  
Old Dec 10th, 2006, 17:37
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chubbs Send a message via Skype™ to chubbs
Re: Images in navi

ohh... ok, so if you can post it later please? iwould like to see it.
Thank you!
Reply With Quote
Reply

Tags
ulli

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
multiple rollover images change multiple images joshlindem Web Page Design 4 Apr 18th, 2008 09:11
CSS Images magnetica Web Page Design 1 Aug 20th, 2007 16:11
Images and SEO spinal007 Search Engine Optimization (SEO) 9 May 5th, 2007 15:57
Uploading Images: Help Need! NewDesigner Classic ASP 0 Oct 12th, 2006 19:08
Help with images tolis Web Page Design 5 May 16th, 2006 00:42


All times are GMT. The time now is 22:51.


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