[Resolved] Is it possible to change 'Container Width' per device?

Home Forums Support Is it possible to change 'Container Width' per device?

  • This topic has 4 replies, 2 voices, and was last updated 2 months ago by David.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1222888
    Andy

    Hi there,

    I am using GenerateBlocks.

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

    #1222962
    Andy

    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;
    }

    #1223125
    David
    Staff
    Customer Support

    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.

    #1223849
    Andy

    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

    #1224499
    David
    Staff
    Customer Support

    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 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.