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.

opacity color on hover over

Featured Replies

Hi there,

 

I am adding opacity to some of my images, I want to add color on hover over... how do I achieve this?

 

I have tried color: .... background-color: but does not work?

 

Here is my css;

 

.fanbox2 img {
opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}
.fanbox2 img:hover {
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}

You can't saturate/desaturate images with CSS (at least, not without proprietary filters and SVG trickery). Your best bet would be to make sprites of the colour and monochrome versions of each image and use background-position and/or opacity.

 

Unless I'm misunderstanding and you just want to add a colour cast to semi-opaque images?

Edited by Renaissance-Design
typo

  • Author

Thanks for the advice, renaissance the closest example I can give is facebooks login page where it has the video on the left, you hover over it and the opacity goes darker but you see the image below .... similar to fancybox style images?

 

I can create an image that takes the colour out and swap on mouse over.

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.