最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - adding fade on mouseover to images

programmeradmin8浏览0评论

I'm a teacher and I have been using blogger for years, but a couple of days ago, I decided to switch to WP and opted for premium plan. I'm not a designer, but am able to do basic things (adding custom css to a blogger theme, or changing html in blog posts) and I've been wondering if there is a way to add a fade effect to images on mouseover with css or html only, without installing any plugins? (for example - to masonry block as well as to specific images only)

Thanks!

I'm a teacher and I have been using blogger for years, but a couple of days ago, I decided to switch to WP and opted for premium plan. I'm not a designer, but am able to do basic things (adding custom css to a blogger theme, or changing html in blog posts) and I've been wondering if there is a way to add a fade effect to images on mouseover with css or html only, without installing any plugins? (for example - to masonry block as well as to specific images only)

Thanks!

Share Improve this question asked Jul 24, 2020 at 8:28 baksudinbaksudin 1 1
  • Normally, this is easily done in css with transition opacity. How easy it is in your case depends on the theme. – cjbj Commented Jul 24, 2020 at 10:25
Add a comment  | 

2 Answers 2

Reset to default 0

You can apply css in style.css or theme.css in your theme folder. also many themes allowing to add css in theme options or Custumize section. You can check css from here on image hover. https://www.w3schools/howto/tryit.asp?filename=tryhow_css_image_overlay_opacity

Thank you. I used this code - grey on hover: img { -webkit-filter: grayscale(0%); /* For Webkit browsers / -webkit-transition: .5s ease-in-out; / For Webkit browsers / -moz-filter: grayscale(0%); / For Firefox / -moz-transition: .5s ease-in-out; / For FireFox */ -o-filter: grayscale(0%); -o-transition: .5s ease-in-out; }

img:hover { -webkit-filter: grayscale(100%); /* For Webkit browsers / -webkit-transition: .5s ease-in-out; / For Webkit browsers / -moz-filter: grayscale(100%); / For Firefox / -moz-transition: .5s ease-in-out; / For Firefox */ -o-filter: grayscale(100%); -o-transition: .5s ease-in-out; }

发布评论

评论列表(0)

  1. 暂无评论