Use of % instead ox pixels - Forum | JoomShaper
Solved SP Page Builder

Use of % instead ox pixels

Asked by H 1 year ago Last activity 1 year ago

When you make a responsive design, you often want to define the height or width of an element not in pixels, but as a percentage of the heigth/width of the parent element.

Is there a way to do this in SPPB? In the properties of most of the addons, you can only give in values in pixels.

Is there a way to deal with this? Besides using custom CSS?

Accepted answer

Marked as the solution
Asfakur Rahman Saikat Staff

Hi there,

Thank you for your question.

You can use custom CSS to set the width or height in percentages by targeting the #addonId in the addon’s styles. For example:
Preview Screenshot

#addonId .sppb-example-class {
    width: 50%;
    height: 75vh;
}

Would you like assistance with a specific addon?

Feel free to ask if you have any further questions.

Best regards

1 more reply

H Asked this

Hello Asfakur,

I know I can use custom css, bu I hoped there might be a better way.

E.g. in sections you can use percentages etc.

I would suggest that you add % , vh etc for all addons in a next release. Would make life much easier.

Asfakur Rahman Saikat Staff

Thank you for sharing your feedback. I will add your request as a feature suggestion, and hopefully, our development team will take it into consideration.

Could you please clarify which specific addon and property you are referring to? This will help us address your request more accurately.

Best regards

H Asked this

I think everywhere where you can specify a heigth or width, and currently you can only give in a pixel value.

Asfakur Rahman Saikat Staff

Hi there,

Thank you for reaching out.
I will submit a feature request for this.

Best regards

Log in to reply.