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.

Image captions override my CSS borders (Carousel Slider Block)

  • Hello,

    I’m currently using the plugin “Carousel Slider Block for Gutenberg” and I’ve added colored borders on the right and bottom sides of the gallery images via CSS.

    However, as soon as I add a caption, the CSS is overwritten and the borders disappear.

    Is there a solution for this?
    The page is password protected: “test”.

    https://ibb.co/f3XZXz3

  • Hi Tom,

    the CSS is targeting WP image block, but the image with caption is a GB image, so even without the caption, the border will not show.

  • Hi Ying,
    Is there anything we can do about it?

  • Eh… I think you can just replace the image with WP image block.

    If adding caption causes the same issue, let me know, so I can see how to modify your CSS.

  • I see, but how then to modify (font , size ) the picture title ?

  • Hi Tom,

    Do you mean the image caption’s font size?

    If so, try selecting the caption block directly and adjust its properties from the block settings panel.

  • Hi Alvind,

    yes, in general I would like to style the image caption which is much easier using a GB image but then the CSS will not work.

    Now it looks like this: https://ibb.co/rKkgLCpM
    when actually I wish it the font was looking like that: https://ibb.co/N21s1bHn

  • Try this CSS:

    .swiper .wp-block-image figure {
        position: relative;
        z-index: 2;
    }
    /*caption text style*/
    .swiper .wp-block-image figcaption {
        text-align: left;
        padding-left: 20px;
        font-size: 20px;
        margin: 0;
    }
     
  • Hi Ying,

    better, but not ideal: https://ibb.co/zWZ2Q32Y

    And how can I style the caption font?

  • You can add your CSS to this:

    /*caption text style*/
    .swiper .wp-block-image figcaption {
        text-align: left;
        padding-left: 20px;
        font-size: 20px;
        margin: 0;
    }

    I’ve defined font-size, you can add font-weight, font-family and other styles you want, if you want to remove the underline, add:
    text-decoration:none;

  • I see, but it´s still overlapping: https://ibb.co/8DLmJmZF

  • Your structure has multuple levels’ elements have overflow:hidden; which will cut off the text if position the text as your example screesnhot.

    Can you remove all the overflow:hidden; from related CSS first?

  • Hi Ying,

    I removed alle overflow:hidden; – Now there is only overflow: visible !important;

    The problem now is, that the width of the slider gallery is more than 1200px

    https://ibb.co/fVF5pvCr

  • Thanks! There are quite a few changes that need to be made just so the text won’t be cut off.

    Try following the steps below:

    1. Add this CSS, you can adjust the bottom value to play with the position of the caption.

    .swiper .wp-block-image figcaption {
        position: absolute;
        bottom: -1.2em;
        z-index: 10;
    }

    2. Change the selectors like .wp-block-image.image-card.coral::after to .wp-block-image.image-card.coral figure::after, so do the same for other colors.

    3. Change the selector .wp-block-image.image-card::after to .wp-block-image.image-card figure::after.

    4. Change this css:

    .cb-carousel-block .swiper, .cb-carousel-block .swiper-wrapper {
        overflow: visible !important;
        padding-right: 15px;
    }

    to:

    .cb-carousel-block .swiper, .cb-carousel-block .swiper-wrapper {
        overflow: hidden;
        padding-right: 15px;
    }

    5.change this CSS:

    .cb-carousel-block .swiper, .cb-carousel-block .swiper-wrapper {
        overflow: hidden;
        padding-right: 15px;
    }

    to this, play with min-height value to find the best fit.

    .cb-carousel-block .swiper, .cb-carousel-block .swiper-wrapper {
        overflow: visible;
        padding-right: 15px;
        min-height: 380px;
    }
  • Wow, that’ s a bunch of CSS…

    I did everything you told me minus .cb-carousel-block .swiper, .cb-carousel-block .swiper-wrapper {
    overflow:visible !important;
    }

    because I could not find it…

    Now the gallery looks like this: https://ibb.co/chpbk2jP

  • Sorry, I didn’t paste the full CSS for #4, I’ve updated it, can you try to find the original CSS?

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