Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with navigation button

Featured Replies

hello everyone. i have designed a navigation button, but i don't know how i would implement this to my site.

 

normalbutton.jpg

this is how my normal button would look like.

 

selected.jpg

and this is how my selected and hovered would look like.

 

how do i save this for web? do i need to save for web them one-by-one. i have 5 navigation buttons (home, about, portfolio, blogs and contact). do i need to save for web a normal home button, normal about button../?

and then do the same with the selected button?

The first thing I would do is to join each normal image to its hover image like

http://www.wickham43.net/images/menuhomecombined.gif

(which has three images, an extra one for the visited state)

which is called a sprite and stops the images giving a short flash as one image changes to the other.

 

Then use the code in the following link, set the "li a" style height to half the combined image, then change the position of the image on hover so that the other half shows.

http://www.wickham43.net/visitedbutton.php Item 2 uses the sprite, (item one doesn't and will flash).

The best way to do this would be to save them as a jpg & have them all lined up as a CSS sprite...I'd suggest having the normal state buttons along the top, then the corresponding hover buttons on the bottom row.

 

I won't go into explaining how to make a CSS sprite work here as it has been done 100's of times before on the net....see:

Css Sprite How To

search 'css sprite' for loads more tutorials

 

In your case, the normal state buttons will want to be aligned to the top, then the hover state aligned to the bottom.

For each button across eg home, about, contact - you will need to change the left/right positioning by using multiples of the button width.

For example, if your buttons are 125px wide, the horizontal positioning would be:

home...0px

about...-125px

contact...-250px

 

Hopefully you can make progress from that.

  • Author

The first thing I would do is to join each normal image to its hover image like

http://www.wickham43.net/images/menuhomecombined.gif

(which has three images, an extra one for the visited state)

which is called a sprite and stops the images giving a short flash as one image changes to the other.

 

Then use the code in the following link, set the "li a" style height to half the combined image, then change the position of the image on hover so that the other half shows.

http://www.wickham43.net/visitedbutton.php Item 2 uses the sprite, (item one doesn't and will flash).

 

 

thanks for the link. i will try that. i think i got the idea. well sort of..

  • Author

The best way to do this would be to save them as a jpg & have them all lined up as a CSS sprite...I'd suggest having the normal state buttons along the top, then the corresponding hover buttons on the bottom row.

 

I won't go into explaining how to make a CSS sprite work here as it has been done 100's of times before on the net....see:

Css Sprite How To

search 'css sprite' for loads more tutorials

 

In your case, the normal state buttons will want to be aligned to the top, then the hover state aligned to the bottom.

For each button across eg home, about, contact - you will need to change the left/right positioning by using multiples of the button width.

For example, if your buttons are 125px wide, the horizontal positioning would be:

home...0px

about...-125px

contact...-250px

 

Hopefully you can make progress from that.

 

i got the idea but i cannot see my image.

Can you see the background image in the normal link state? If not, perhaps the path is wrong.

 

My method used a vertical combined image so the hover state "li a" style is repositioned vertically whereas craftygeek's method assumes horizontal combined image which is different to my method.

  • Author

i set it up like this

 

 

navsprites.jpg

 

i can notice that it was there but i just cant see it. it's like something is occupying the space but there is none.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.