Site logo

[Resolved] Add border radius to Gutenberg Image Block images

Home Forums Support [Resolved] Add border radius to Gutenberg Image Block images

Home Forums Support Add border radius to Gutenberg Image Block images

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1916886
    Brent Wilson

    How can I add a border radius to images added via the standard Gutenberg Image Block?

    In the block settings, I added image-radius as an additional css class.

    I tried adding this css in the customizer:

    .image-radius {
    		border-radius: 3px;
    }

    And also tried this css:

    .image-radius img {
    		border-radius: 3px;
    }

    What might I be doing wrong?

    #1916895
    Ying
    Staff
    Customer Support

    Hi Brent,

    Your CSS is correct. it’s just been overriding by the default WP image block’s CSS.

    Try this CSS instead to be more specific:

    body .wp-block-image:not(.is-style-rounded).image-radius img {
        border-radius: 3px;
    }
    #1916919
    Brent Wilson

    Thanks! That worked! Would adding !important to my original css be another way to override the default block css?

    #1916922
    Ying
    Staff
    Customer Support

    I think so 🙂

    #1916932
    Brent Wilson

    Thanks

    #1916936
    Ying
    Staff
    Customer Support

    No problem 🙂

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