Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Max width text block

Max width text block

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    A
    Anthony
    wrote on last edited by
    #1

    Hello

    I'd like to create a text block that has a max width and then remain centred horizontally once the max width is reached.

    Adding the max-width element is fine with a html class and custom css. However, I can't work out if there is a way to tell the text block to centre within it's allocated columns once the max-width is reached.

    Any workaround possible to create this.

    I would use the max width settings within Lay, but it is only text blocks that I want to stop scaling after a certain point.

    Many thanks!

    1 Reply Last reply
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @Anthony
      can you show us a rough sketch to illustrate your idea?

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • edgrbnzE
        edgrbnzE
        edgrbnz
        wrote on last edited by edgrbnz
        #3

        I'm having a similar but different problem.

        I have two classes which define different max-widths (for text-blocks) and have both assigned to different text-blocks on the same page. Wenn I scale the window these text-blocks don't stay in their gridder collumns and start free floating all around the page. (see screenshot)

        0_1533551600840_Window_and_Moritz_Welker_—_Info.jpg

        The CSS I used is pretty simple:

        ._mw-500{
        max-width: 500px!important;
        }
        ._mw-600{
        max-width: 640px!important;
        }
        ._mw-1000{
        max-width: 1000px!important;
        }
        ._mw-1300{
        max-width: 1300px!important;
        }
        

        ✦ ✦ ✦

        1 Reply Last reply
        0
        • A
          A
          Anthony
          wrote on last edited by Anthony
          #4

          Hi Marius

          Thanks for replying, I have created a test page to illustrate what I am trying to achieve. Also attached two marked up screen shots.

          I want these blocks to alway appear in the centre of the browser window.

          http://founded.design/testing-testing-123

          Marked up screen shots:
          http://founded.design/screen-shot-2018-08-07-at-11-10-38/
          http://founded.design/screen-shot-2018-08-07-at-11-10-47/

          Many thanks
          A

          1 Reply Last reply
          0
          • mariusjopenM
            mariusjopenM
            mariusjopen
            Global Moderator
            wrote on last edited by
            #5

            Dear @Anthony

            you can use this to position the box.
            It gets pushed 50% to the right and then gets pushed back 250px, which is the max-width.

            .maxwidthtextblock {
                margin-left: calc(50% - 250px) !important;
            }
            

            Propably you need to play around with that for smaller screen sizes. But you can do that easily with MediaQueries or the Custom-mobile-CSS.

            Let me know if that helped.

            Best!

            Marius

            www.mariusjopen.world

            A 1 Reply Last reply
            1
            • mariusjopenM mariusjopen

              Dear @Anthony

              you can use this to position the box.
              It gets pushed 50% to the right and then gets pushed back 250px, which is the max-width.

              .maxwidthtextblock {
                  margin-left: calc(50% - 250px) !important;
              }
              

              Propably you need to play around with that for smaller screen sizes. But you can do that easily with MediaQueries or the Custom-mobile-CSS.

              Let me know if that helped.

              Best!

              Marius

              A
              A
              Anthony
              wrote on last edited by
              #6

              @mariusjopen Thanks Marius, I ended up using auto for left and right margins. I hadn't used !important when trying before and this is working great now.

              1 Reply Last reply
              0
              • mariusjopenM
                mariusjopenM
                mariusjopen
                Global Moderator
                wrote on last edited by
                #7

                Dear @Anthony
                great! Happy to hear!

                Marius

                www.mariusjopen.world

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Online Users
                K
                kp-hb
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search