Add Image Border Radius to div class mfp-content - Forum | JoomShaper
Solved SP Page Builder

Add Image Border Radius to div class mfp-content

Asked by BOFHJunior 3 years ago Last activity 3 years ago

I was able to add a Border Radius to the SPPB Addon Gallery with the CSS Code (without "")

"#addonId .sppb-addon-gallery img {

border-radius: 10px;

}"

But if i select the image to expand it, the edges are not rounded. :-(

I investigated the scource code and figured out that the image is in the div class="mfp-content" and tried several CSS commands but the edges don't get rounded.

Any ideas?

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

Sorry, it worked on my site.

Maybe add into Page Settings > Custom CSS as I did

5 more replies

Paul Frankowski Senior Staff

Hi,

you need border-radius also for 2 classes. Use that, whole part

img.mfp-img {
  padding: 0;
  margin: 40px auto;
  border-radius: 10px;
}
.mfp-figure::after { border-radius: 10px;}

Yes, I used Code Inspector (Firefox)

BOFHJunior Asked this
3 years ago · edited

Hey Paul,
thx for your quick reply.

I tried this Code but the edges are still not rounded when opening the image in lightbox.

I tried also ".modal-container" before "img.mfp-img" and " !important" after "border-radius: 10px" but this also didn't helped.

I also used ChatGPT for help and it told me, that in my <img class="mfp.img" ...> the img in the beginning is missing.

See the incpected Code: https://prnt.sc/zZWRAToeLEuf (no CSS is applied)

Should it look like this: <img class="img.mfp.img" ...> ?

May this be the reason why its not working?

Is the SPPB Addon Image bugged?

Paul Frankowski Senior Staff
3 years ago · edited

Should it look like this: <img class="img.mfp.img" ...> ?

No No No, in class name no dots, never. Better learn yourself from trusted books and tutorials. Not ChatGPT.

Paul Frankowski Senior Staff

I don't know how you tested my CSS code, but it worked (works) with Gallery addon here is evidence

info_1516_2023.jpg


I think the topic is closed. You're welcome, Have a good day.

BOFHJunior Asked this

Hey Paul.

I did the following steps:

  1. Added the Addon Gallery to my testpage
  2. Selected the Addon Gallery and switched to the "Style" tab
  3. Added your code: https://prnt.sc/TIB1XwmzjWhY
  4. Reloaded the page

Result: No rounded edges: https://prnt.sc/OGqf0yLY8rVn

Same result in Edge and Chrome.

BOFHJunior Asked this

Hi,

adding it into the Custom CSS field in Helix Framework solved the issue.
Thank you so much i was very frustrated.

But why the hell it is not working if i add it into the Custom CSS field of the Addon?

Log in to reply.