Site logo

Archived topic

Is it possible to change 'Container Width' per device?

4 replies · Started by Andy on April 1, 2020

Viewing posts 1–5 of 5

Hi there,

I am using GenerateBlocks.

I am trying to create a center-aligned narrow landing page (Title, image, text).

Solved with this code! (I found under one of your templates)

/* Narrow content */

.no-sidebar .inside-article > *,
.no-sidebar #comments,
.no-sidebar .nav-links {
max-width: 700px;
margin-left: auto;
margin-right: auto;
}

Hi there,

glad you found a solution - but i am not sure what the issue was that couldn't be solved by setting Container Width of the Container Block:

https://docs.generateblocks.com/article/container-overview/

You may have needed to reduce the width a little further to account for the Containers padding ie. 620px would achieve the same result as your CSS.

ah damn, you are right! I should have done that.

May I ask how you settled on 620px as oppose to say, 700px? What should I be looking for in the code to make that decision? OR am I just overanalyzing this?

Thanks,
Andy

Its to do with the Padding being inside the container your CSS was reducing in width, so your 700px wide container, deduct the left and right padding of 40px each gave you 620px.

And possible little bit over analysis :)

This archived topic is closed to new replies.