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.

Background Img disappears on Hover

Featured Replies

Hi,

 

Everytime i hover over the link the background image disappears, it seems to work ok in a blank template though! -

 

Here is the link: -

www dot myweddingreviews.co.uk/sample-advertising-packages/gold-package-example dot html

 

<html>
<head>
<style type="text/css">

.searchActionLinks{background-image:url('actionLinks.png');background-repeat:no-repeat;display:inline-block;margin-left:3px;padding-left:18px;}
.search-contactus:hover{background-position:0 -34px;}
.search-contactus{background-position:0 0;}
.search-website:hover{background-position:0 -170px;}
.search-website{background-position:0 -136px;}
.search-save:hover{background-position:0 -102px;}
.search-save{background-position:0 -68px;}

</style>
</head>
<body>

<div> 
<a class="search-contactus searchActionLinks" href="#">Contact Us</a> 
<a class="search-website searchActionLinks" href="#">Website</a> 
<a class="search-save searchActionLinks" href="#">Save</a> 
</div> 

</body>
</html>

 

Hope you guys can help.

 

Cheers

is it disappearing or is the hover sprite offset showing white?

  • Author

the image is a sprite and its transparent in between each icon.

 

This is my first sprite, so im a newbie at this.

Changed my mind lol I'm a bit rusty at the moment

 

try adding the a to the rule

 

a.searchActionLinks{}

 

that should stop it being overwritten

 

Its because of your

a:hover ,a:visited {background:inherit;}

Edited by mteam

  • Author

tried that mate, still doing the same thing, just showing white or the hover disappearing.

 

Not tried the change i emailed you about, ive been moved onto some work thats got a deadline of end of this month so hopefully will get chance to look at it in more detail then.

 

Thanks again.

No sorry I didn't explain properly you need to add the a to your existing rule

 

a.searchActionLinks {
   background-image: url("images/actionLinks.png");
   background-repeat: no-repeat;
   display: inline-block;
   margin-left: 3px;
   padding-left: 18px;
}

 

not just

 

a.searchActionLinks {/* I should have shown your existing code here*/}

Edited by mteam

  • Author

That works mate, ive tried in in Chrome developer tools - but ill add it to the css when i get home.

 

Thanks for your help AGAIN! :-)

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.