Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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 599 Views
  • 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 Offline
    A Offline
    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 Offline
      mariusjopenM Offline
      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 Offline
        edgrbnzE Offline
        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 Offline
          A Offline
          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 Offline
            mariusjopenM Offline
            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 Offline
              A Offline
              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 Offline
                mariusjopenM Offline
                mariusjopen
                Global Moderator
                wrote on last edited by
                #7

                Dear @Anthony
                great! Happy to hear!

                Marius

                www.mariusjopen.world

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                šŸ’æ Email me here: šŸ’æ
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                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