Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Zoom effect on background image

  • Perfect!

  • But— with first code works, with this doesn’t work

    .hover-scale-bg::before {
    content: ”;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    }

    .hover-scale-bg:hover::before {
    transform: scale(1.1);
    }

    .hover-scale-bg.image-2::before {
    background-image: url(‘https://www.staging2.baitarondanino.it/wp-content/uploads/2021/11/another-image.jpg’);
    }

    .hover-scale-bg.image-3::before {
    background-image: url(‘https://www.staging2.baitarondanino.it/wp-content/uploads/2021/11/yet-another-image.jpg’);
    }

  • The container classes need to be like this:

    Container class with image-2

    Container class with image-3

    Then, CSS needs to be like this:

    .hover-scale-bg::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        transition: transform 0.4s ease;
    }
    
    .hover-scale-bg.image-2::before {
    	background-image: url('https://www.staging2.baitarondanino.it/wp-content/uploads/2021/11/another-image.jpg');
    }
    
    .hover-scale-bg.image-3::before {
            background-image: url('https://www.staging2.baitarondanino.it/wp-content/uploads/2021/11/yet-another-image.jpg');
    }
    
    .hover-scale-bg:hover::before {
        transform: scale(1.1);
    }

    But, remember to put the URL of the images here!

    .hover-scale-bg.image-2::before {
    	background-image: url('https://library.generateblocks.com/wp-content/uploads/2020/07/another-image.jpg');
    }
    
    .hover-scale-bg.image-3::before {
    background-image: url('https://www.staging2.baitarondanino.it/wp-content/uploads/2021/11/yet-another-image.jpg');
    }

    The names I have chosen there are random: another-image.jpg and yet-another-image.jpg. You need to replace those with real image URLs!

  • Yep! The problem was that in additional classes I insert “.” before “hover” and before “image”…
    Thanks!

  • Great, you are welcome.

Viewing 5 posts - 17 through 21 (of 21 total)
  • You must be logged in to reply to this topic.