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.

Stuck creating a CTA section

  • Hey…

    I want to create a CTA like this: https://ibb.co/p38Ryr6

    …exactly on same place here: https://ibb.co/FBTsdDR (My Site)

    I tried creating a section but it doesn’t end up looking good on different devices: https://ibb.co/Q9GTY6Q

    Can you please help…

  • Hi there,

    using the Grid Block for that kind of thing will give you a lost of headaches.
    Try this layout:

    1. create a draft page, and in the top bar 3 dot menu , switch to code editor

    2. copy and paste in this block HTML

    
    <!-- wp:generateblocks/container {"uniqueId":"4515981e","backgroundColor":"var(\u002d\u002dbase-2)","isDynamic":true,"blockVersion":4,"blockLabel":"Flex Wrapper Relative position","display":"flex","alignItems":"center","position":"relative","sizing":{"width":"max-content"},"spacing":{"paddingTop":"15px","paddingLeft":"15px","paddingRight":"15px","paddingBottom":"15px","marginTop":"","marginLeft":"","marginRight":"","marginBottom":""},"borders":{"borderTopLeftRadius":"50px","borderTopRightRadius":"50px","borderBottomLeftRadius":"50px","borderBottomRightRadius":"50px"}} -->
    <!-- wp:generateblocks/container {"uniqueId":"935c8a6c","isDynamic":true,"blockVersion":4,"blockLabel":"Image Container Fixed Width","flexShrink":1,"sizing":{"width":"150px","height":""}} -->
    <!-- wp:generateblocks/image {"uniqueId":"a5d83390","sizeSlug":"full","width":"180px","blockVersion":2,"className":"abs-position"} -->
    <figure class="gb-block-image gb-block-image-a5d83390"><img class="gb-image gb-image-a5d83390 abs-position" src="https://247vehiclerecoverylondon.co.uk/wp-content/uploads/2024/02/a-worker-showing-a-call-sign-1024x1024.png" alt=""/></figure>
    <!-- /wp:generateblocks/image -->
    <!-- /wp:generateblocks/container -->
    
    <!-- wp:generateblocks/container {"uniqueId":"54857908","backgroundColor":"var(\u002d\u002dbase-3)","isDynamic":true,"blockVersion":4,"blockLabel":"Text and Button Container","typography":{"textAlign":"center"},"spacing":{"paddingTop":"20px","paddingLeft":"40px","paddingRight":"40px","paddingBottom":"20px"},"borders":{"borderTopLeftRadius":"40px","borderTopRightRadius":"40px","borderBottomLeftRadius":"40px","borderBottomRightRadius":"40px"}} -->
    <!-- wp:generateblocks/headline {"uniqueId":"9b9c04fd","element":"div","blockVersion":3,"typography":{"fontSize":"14px"}} -->
    <div class="gb-headline gb-headline-9b9c04fd gb-headline-text">CALL US AND WE’LL COME TO YOU</div>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/button {"uniqueId":"43a65de7","hasUrl":true,"blockVersion":4,"display":"inline-flex","alignItems":"center","columnGap":"0.5em","typography":{"fontSize":"24px"},"spacing":{"paddingTop":"5px","paddingRight":"5px","paddingBottom":"","paddingLeft":"5px"},"textColor":"var(\u002d\u002dcontrast)","textColorHover":"var(\u002d\u002dcontrast)","hasIcon":true,"iconStyles":{"height":"1em","width":"1em"}} -->
    <a class="gb-button gb-button-43a65de7" href="tel:020 7946 0569"><span class="gb-icon"><svg aria-hidden="true" role="img" height="1em" width="1em" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z"></path></svg></span><span class="gb-button-text"><strong>20 7946 0569</strong></span></a>
    <!-- /wp:generateblocks/button -->
    <!-- /wp:generateblocks/container -->
    <!-- /wp:generateblocks/container -->
    

    3. Switch back to the Visual editor to see the blocks

    In the editor you will see this layout:

    https://app.screencast.com/AtMIcFa5i58a7

    Points to note about each of the blocks in the list view:

    1. the Flex Wrapper
    Has a Layout > Display of Flex, and a Position of Relative.
    Its Sizing > Width is set to max-content

    2. the Image Container has a Width of 150px which is the same as the Image block inside it.

    3. the Image Block has an Advanced > Additional CSS Class of: abs-position
    The image block is using a URL to that Image of yours.

    4. Add this CSS:

    
    .abs-position {
        position: absolute;
        bottom: 0;
    }
    

    The CSS will position the image absolutely to the bottom of the #1 Container. Which will create the breakout and overlap effect for you.

  • Hey..

    Thanks.

    But where should I add that CSS? from the 4th point you’ve instructed.

  • You can add it to the Customizer > Additional CSS.

  • It works. Thank you!!

  • You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.