Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Margin/padding with 0 are ignored in frontend

Featured Lock Resolved Bug
I've noticed an issue (starting from version 3.1 to 3.1.2) whereby if you use 0 (and not 0px) in margin or padding or any parameter which has 'sp-pagebuilder-device-tabs' options, then the css is ignored in mobile and ipad if it has 0 (without the 'px').

How to reproduce the issue
1. Drop an addon in SP Page builder front end e.g. Feature Box
2. Navigate to Styles tab and set the margin as follows:
a) Desktop: -30px 0px 30px 0px;
b) tablet: 0 0 30px 0;
c) mobile: 0 0 20px 0;
3. Save.
4. If you toggle the view to mobile and then inspect the addon, you'll notice the margins are applied. e.g.
@media (max-width: 767px) {
#sppb-addon-1519677285754 {
margin-top: 0;
margin-right: 0;
margin-bottom: 30px;
margin-left: 0;
}
}
#sppb-addon-1519677285754 {
margin-top: -50px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}

So in the code above the margin-top for mobile screens will be 0 instead of -50px.

Now close the Page Builder and view the addon in css in mobile view; The desktop shows ok but for the tablet and mobile, it doesn't consider the '0' and only shows the value that had 'px' values.

@media (max-width: 767px){
#sppb-addon-1519677285754 {
margin-bottom: 30px;
}
}
#sppb-addon-1519677285754 {
margin: -50px 0px 0px 0px;
}

So in this case the margin-top for mobile screens will be -50px instead of 0.

3 Answers

Please login to view replies.

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 158
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 108
Toufiq

Toufiq

Total Accepted Answers: 51
Pavel

Pavel

Total Accepted Answers: 7
Tabassum

Tabassum

Total Accepted Answers: 5

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us