stuck with simple pictures alignment within an element grid with custom row height
-
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; }
-
@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:
On this screen size, the bottom padding is equal to the top one.
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
-
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
-
and i always need a link to really see whats going on. otherwise im just guessing
-
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!
-
then add your code piece by piece to see which part of it makes it not work properly
did u try this?
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
-
.type-elementgrid{ padding-bottom:0!important; }
maybe
-
you need to find out the sizes
look, the two bars: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=12to 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 -
@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
-
can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- 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:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it