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.

css based image rollovers

Featured Replies

Hey all!

 

I'm trying to figure out how to create a css based rollover for a link, using images.

 

I going to have six images placed horizonatlly inside a div and on rollover, I just want the colours to reverse out from themselves. I haven't started yet but, I'm thinking, would my html/css look something like this for the link?:

 

<a href="http://www.webdesignforum.co.uk"> <img src= "gifs/myimg.gif"></a>

 

# mynavbar:hover {

background-image: url(gifs/myimg.gif);

}

 

An example of what I'm trying to acheive is shown on this site (4 images at the bottom of the page)

http://www.bbc.co.uk/radio1/hiphoprnb/

 

Thanks all - I appreciate you'll taking the time to have a look and help me out!!

 

Riggers...

You can use a "sprite" which is a combined image, one for normal and one for hover (and another for visited if you want) either one on top of the other or side by side and then code them for the "a" tag and the "a:hover" styles so that the normal link state only shows the height of the normal part of the combined image and the hover style is offset by a certain size so that only the hover part of the image shows. See

 

http://css-tricks.com/css-sprites/

  • Author

You can use a "sprite" which is a combined image, one for normal and one for hover (and another for visited if you want) either one on top of the other or side by side and then code them for the "a" tag and the "a:hover" styles so that the normal link state only shows the height of the normal part of the combined image and the hover style is offset by a certain size so that only the hover part of the image shows. See

 

http://css-tricks.com/css-sprites/

cheers dude - i'll give that a bash!

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.