- This topic has 17 replies, 6 voices, and was last updated 4 years, 5 months ago by
David.
-
AuthorPosts
-
June 9, 2021 at 5:59 am #1816038
Anders
Hi
this was a struggle. I want rounded corners on an image. I have this css in the customizer:
/* rounded corners class assigned to generateblocks images */.rounded-corners img {
border-radius: 12px;
}and also this
/* rounded corners images */
.wp-block-image {
border-radius: 10px !important;
}I tried both classes in the image block under “Advanced” but none of the works. Why?
June 9, 2021 at 6:35 am #1816082David
StaffCustomer SupportHi there,
Try this:
1. Edit the Image Block – in Advanced > Additional CSS add:
rounded-corners2. Add this CSS:
.wp-block-image:not(.is-style-rounded).rounded-corners img { border-radius: 12px; }June 9, 2021 at 8:33 am #1816434Anders
works! How come I need all that code?
June 9, 2021 at 8:44 am #1816448David
StaffCustomer SupportYou can try just this CSS:
.wp-block-image.rounded-corners { border-radius: 10px; }I added the extra selectors as your cache plugin is subtly changing the order of the CSS …. and i wanted to make sure our custom CSS was more specific 🙂
June 9, 2021 at 9:15 am #1816476Anders
OK I see, thanks!
June 9, 2021 at 10:03 am #1816515David
StaffCustomer SupportYou’re welcome
August 12, 2021 at 12:50 pm #1893895Alan
Hi David
The first bit of code at #1816082 worked but the second one #1816448 won’t.
When I’m adding the css in the block “advanced additional css classes” do I remove the existing part that says either is-style-default or is-style-rounded and replace it with rounded-corners
rounded-cornersor do I just add the extra class like this
is-style-default rounded-cornersThanks
August 12, 2021 at 1:15 pm #1893910Leo
StaffCustomer SupportCan you link us to the page in question?
Feel free to open a new topic if want to use the private info field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-informationAugust 12, 2021 at 1:58 pm #1893930Alan
August 12, 2021 at 2:15 pm #1893936Leo
StaffCustomer SupportLooks like it’s all working for me?
https://www.screencast.com/t/tU2f76gMP52FAugust 12, 2021 at 8:42 pm #1894107Alan
Thanks Leo. Can you please tell me which was the correct way of adding the css in the block “advanced additional css classes” .
Do I remove the existing part that says either is-style-default or is-style-rounded and replace it with rounded-corners
rounded-cornersor do I just add the extra class like this
is-style-default rounded-cornersIt works both ways. I just want to know which is correct. At the moment I’ve just got
rounded-cornersin the additional css box
Thanks
August 12, 2021 at 9:13 pm #1894123Elvin
StaffCustomer SupportHi there,
If you’re using David’s CSS, you only need to add
rounded-corners. You can ignore the rest. 🙂August 12, 2021 at 9:14 pm #1894125Alan
Thanks Elvin !
August 12, 2021 at 9:24 pm #1894128Elvin
StaffCustomer SupportNo problem. 😀
October 20, 2021 at 4:04 am #1969428Henry
Using Generate Blocks Pro – I have an image inside a container and I’m trying to get rounded corners. If I click on the rounded image under styles I get a circle. I tried pasting both the versions of the above CSS code with the image set to default and tried rounded but it has no effect. I get either a circle or a square. I first tried setting border-radius in the container but that had no effect either.
The image is set to full size and the container to full width
-
AuthorPosts
- You must be logged in to reply to this topic.