简体   繁体   中英

Rollover fade on fluid image

I'm creating a responsive site with a gallery composed of fluids images . For this, I must use css img {max-width: 100%;} . I also want a fade effect on hover.

Does anyone have a solution to this?

So far, all the solutions I've tried, does'nt work with css img {max-width: 100%;}

Thank you very much for your help!

Define image width also along with its max-width. And it must be in pixels or em's. You don't need to keep max-width or min-width in %'s. Browser renders from its original width or height value. As

This is for example.

img{
    width:50%;
    height:30%;
    max-width:300px;
    min-height:100px;
    }

And every images'll be flexible with viewport.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM