This is a discussion on "Navigation, different image per link" within the Web Page Design section. This forum, and the thread "Navigation, different image per link are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Navigation, different image per link
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Navigation, different image per link
Hi All,
What would be the best way to code an image Nav bar that has a different image for each link? ![]() ta muchly, |
|
|
|
#2
|
|||
|
|||
|
Re: Navigation, different image per link
I would make a separate graphic of each word.
Then create a vertical navigation using background images. Karinne has a nice tutorial. Here is another tutorial. http://www.udm4.com/demos/other-imagenav.php This ones shows spaces between the images but you could delete the margins or padding to make them touch each other. Hope this helps! |
|
#3
|
|||
|
|||
|
Re: Navigation, different image per link
Cheers dude,
Got very lost following that second tutorial. I'm struggling to intergrate links, image replacement and background images into the image navbar... currently I have..
![]() |
|
#4
|
|||
|
|||
|
Re: Navigation, different image per link
Should you not be putting the image links within the list items rather than writing 'Home' etc within the spans? That's what's making the written items appear also. I'm probably completely wrong though (as I usually am when I try and help out with coding issues
|
|
#5
|
|||
|
|||
|
Re: Navigation, different image per link
HTML:
So in the CSS:
I'll tell you what I did. First I removed the bullet points from the list itmes with list-style: none; after this i formatted the text. I made it so that it won't appearonscreen with text-indent: -9999px. That moves the text one thousands pixels to the left. The display block ensures that the li a doesn't collapse due to it having no content. We also need to remove any undeline as this can appear in the window despite our text being moved off screen. I set this here so we didn't have to do it for every single li a due to them having different classes. This saves time and reduces file size. We set the width and height of each element to match the images. This will probably be different for each link so we will have to set it on each element seperately, using the class to select it. The last thing is to set an image as the background. We do this as above just change the file names to the real ones. Repeat the above code for the other list elements. Did I already say that? You may need to play around with some of the margins/paddings etc but this is the basic css. Pete. |
|
#6
|
|||
|
|||
|
Re: Navigation, different image per link
Fantastic mate that has done the trick.
Was tieing myself in knots trying to use <span> but your method is much better. Thank you for your time. |
|
#7
|
|||
|
|||
|
Re: Navigation, different image per link
No problem, I always found styling lists with css one of the hardest things to master.. If you want a different image, maybe a slightly different colour or something, on hover then just either add a different background image using a:hover as well as what you have or even better just use a single image and chnage the position of that image. The link that linda provided before shows how to do that.
Post again if you have any more problems. Pete. |
![]() |
| Tags |
| image, navigation, non repeating |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS Background Image as a Link? | TheLion | Web Page Design | 4 | Jan 18th, 2008 11:28 |
| CSS image link attributes | robertl | Web Page Design | 8 | Nov 27th, 2007 03:27 |
| Putting navigation list on top of background image | Kurt | Web Page Design | 5 | Sep 16th, 2007 07:19 |
| Image Navigation Links | csa | Web Page Design | 0 | Aug 8th, 2006 15:46 |
| List style / rollover image navigation disappears in IE on the Mac | eskymo | Web Page Design | 5 | Mar 1st, 2006 00:43 |