Community forum for knowledge and support

Updated 12 months ago

Applying margin and padding classes as combo class or creating a separate margin div

At a glance

The post asks whether one should apply margin-xxx and padding-xxx classes as a combo class to container-xxx classes, or create a separate margin-xxx div inside the container class. The community members discuss this, with one suggesting that combo classes are generally not expected on core structure classes like container, padding-global, and padding-section-large. They recommend using a new div with padding classes instead. Another community member mentions that a recent guide suggested combining padding-section-xxx with padding-global, which is why they asked the question. However, the final community member states that they would not expect to see combo classes or additional styles applied to the container class.

Should one apply margin-xxx and padding-xxx classes as combo class to container-xxx classes?

Or should one create a separate margin-xxx div inside the container class?

M
R
3 comments

guess that would depend on the design really. Overall I probably wouldn't expect to see any combo classes at all on any of the core structure classes like container, padding-global, padding-section-large - though my favorite little trick with padding-section-large etc classes is to add padding-bottom or padding-top to them if I have two sections with the same background color on them - reducing the spacing a bit.

But yeah, I think a new div with padding classes is likely the answer.

Thank you! Yes, I was seeing that CF guide is mentioning to add padding-section-xxx to the padding-global, that’s why I asked

ah yeah, that was a recent change to combo those two together. But I wouldn't expect to see combo classes or additional styles done to container.

Add a reply
Sign up and join the conversation on Slack