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. stuck with simple pictures alignment within an element grid with custom row height

stuck with simple pictures alignment within an element grid with custom row height

Scheduled Pinned Locked Moved General Discussion
13 Posts 3 Posters 292 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.
  • arminunruhA Offline
    arminunruhA Offline
    arminunruh
    Global Moderator
    wrote on last edited by arminunruh
    #4

    hey!

    if you create an elementgrid, choose same-height for the layout type, enter any pixel value

    then enter this css into lay options → custom css & html:

    .elements-collection-region.same-height img{
        height: 70vh!important;
        width: auto!important;
    }
    .elements-collection-region.same-height .element-collection{
        display: flex;
        justify-content: center;
    }
    .elements-collection-region.same-height .element-wrap:last-child{
        margin-right: 0!important;
    }
    .elements-collection-region.same-height .element-wrap{
        margin-bottom: 0!important;
    }
    
    U 1 Reply Last reply
    0
    • arminunruhA arminunruh

      hey!

      if you create an elementgrid, choose same-height for the layout type, enter any pixel value

      then enter this css into lay options → custom css & html:

      .elements-collection-region.same-height img{
          height: 70vh!important;
          width: auto!important;
      }
      .elements-collection-region.same-height .element-collection{
          display: flex;
          justify-content: center;
      }
      .elements-collection-region.same-height .element-wrap:last-child{
          margin-right: 0!important;
      }
      .elements-collection-region.same-height .element-wrap{
          margin-bottom: 0!important;
      }
      
      U Offline
      U Offline
      user-4'33''
      wrote on last edited by
      #5

      @arminunruh Thank you, that worked well!

      The only problem left is, that the top and bottom padding between the images seems to behave different on different screen sizes:
      screen1.jpeg
      On this screen size, the bottom padding is equal to the top one.

      screen2.jpeg
      But here, the bottom padding is smaller than the one on the top.

      I got some custom top and bottom padding for the row itself with:

      .row3impressions {
          padding-top: calc(0.6vh * 2);
          padding-bottom: calc(0.6vh * 2);
          position: sticky;
          top: calc(2 * (0.29vw + 2.63vw + 0.29vw + 3px));
          width: 100%;
          z-index: 0;
      }
      

      The (description) and (contact) menu are both sticky with a bottom property.

      Any guess how I could approach this?

      Thanks and all best

      1 Reply Last reply
      0
      • arminunruhA Offline
        arminunruhA Offline
        arminunruh
        Global Moderator
        wrote on last edited by
        #6

        Screenshot 2024-10-28 at 17.19.03.png

        i think the spaces in the two cyan circles i marked are different, because you use

        top: calc(2 * (0.29vw + 2.63vw + 0.29vw + 3px));
        

        probably better to just have a row thats 70vh, then use my code and approach from my last post to insert your images

        then comment out your code

        then add your code piece by piece to see which part of it makes it not work properly

        maybe you can simplify your top: statement

        U 1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by
          #7

          and i always need a link to really see whats going on. otherwise im just guessing
          Screenshot 2024-10-28 at 17.22.40.png

          1 Reply Last reply
          0
          • arminunruhA arminunruh

            Screenshot 2024-10-28 at 17.19.03.png

            i think the spaces in the two cyan circles i marked are different, because you use

            top: calc(2 * (0.29vw + 2.63vw + 0.29vw + 3px));
            

            probably better to just have a row thats 70vh, then use my code and approach from my last post to insert your images

            then comment out your code

            then add your code piece by piece to see which part of it makes it not work properly

            maybe you can simplify your top: statement

            U Offline
            U Offline
            user-4'33''
            wrote on last edited by
            #8

            @arminunruh

            I did use your code for sure! But still got this fitting problem...

            The top statement is actually

            .row3impressions {
                padding-top: calc(var(--row-top-padding) * 2);
                padding-bottom: calc(var(--row-bottom-padding) * 2);
                position: sticky;
                top: calc(2 * (var(--menu-top-padding) + var(--menu-font-size) + var(--menu-bottom-padding) + var(--line-strokewidth)));
                width: 100%;
                z-index: 0;
            }
            

            while my global variables are as follows:

            :root {
                --menu-top-padding: 0.29vw;
                --menu-bottom-padding: 0.29vw;
                --menu-font-size: 2.63vw;
                --row-top-padding: 0.6vh;
                --row-bottom-padding: 0.6vh;
                --line-strokewidth: 3px;
            }
            

            I write it like this because the sum of the top values are equal to the two menu bars I placed there (namely (Erinnerungsservice) and (impressions). With this, it is way easier to tweak the parameters which are on multiple project sites.

            Also, sorry for not posting a link, should have done that before. Here it is! Pw is laytheme

            Thank you for your help, appreciate it!

            1 Reply Last reply
            0
            • arminunruhA Offline
              arminunruhA Offline
              arminunruh
              Global Moderator
              wrote on last edited by
              #9

              then add your code piece by piece to see which part of it makes it not work properly

              did u try this?

              Screenshot 2024-10-29 at 09.58.26.png

              there is a huge padding bottom set here

              you need to use for example the chrome inspector and look at the elements and see which css is applied to see why

              1 Reply Last reply
              0
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by
                #10
                .type-elementgrid{
                padding-bottom:0!important;
                }
                

                maybe

                1 Reply Last reply
                0
                • arminunruhA Offline
                  arminunruhA Offline
                  arminunruh
                  Global Moderator
                  wrote on last edited by arminunruh
                  #11

                  you need to find out the sizes
                  look, the two bars:

                  Screenshot 2024-10-29 at 10.02.01.png

                  they are both around 164px in height

                  so your row should be

                  100vh - 328px

                  (whole browser height minus the bar heights)

                  use a program like https://flexruler.apponic.com/mac/
                  or https://apps.apple.com/de/app/free-ruler/id1483172210?mt=12

                  to measure things

                  70vh doesnt make any sense i think
                  not sure how you came up with 70vh, this would only make sense if both bars had a height of 15vh

                  U 1 Reply Last reply
                  0
                  • arminunruhA arminunruh

                    you need to find out the sizes
                    look, the two bars:

                    Screenshot 2024-10-29 at 10.02.01.png

                    they are both around 164px in height

                    so your row should be

                    100vh - 328px

                    (whole browser height minus the bar heights)

                    use a program like https://flexruler.apponic.com/mac/
                    or https://apps.apple.com/de/app/free-ruler/id1483172210?mt=12

                    to measure things

                    70vh doesnt make any sense i think
                    not sure how you came up with 70vh, this would only make sense if both bars had a height of 15vh

                    U Offline
                    U Offline
                    user-4'33''
                    wrote on last edited by
                    #12

                    @arminunruh I tried to add my code piece by piece and as far as I could see, it is always about the height value of

                    .elements-collection-region.same-height img {
                        height: 70vh !important;
                        width: auto !important;
                    }
                    

                    in combination with the padding-bottom you posted in the screenshot. This padding is added via right-clicking the element grid and giving it a 5% value for "Space Below". I removed those 5% and tried the calculation you suggested. Since it is 2 times the menu bar, this is:

                    height: calc(100vh - (2 * (var(--menu-top-padding) + var(--menu-font-size) + var(--menu-bottom-padding) + var(--line-strokewidth)))) !important;
                    

                    I also tried:

                    height: calc(100vh - 328px) !important;
                    

                    Unfortunately, both didn't help. (The padding-bottom property of the .type-element was also not the right choice... )

                    I would be truly thankful if you could still try to help me with this problem. Your support is very much appreciated...

                    All the best

                    1 Reply Last reply
                    0
                    • arminunruhA Offline
                      arminunruhA Offline
                      arminunruh
                      Global Moderator
                      wrote on last edited by
                      #13

                      can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

                      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