-
AuthorPosts
-
November 5, 2020 at 12:54 pm #1258591
Hi,
My designer has made a request for two elements on a stretched lay-out with fixed container-size.
It is 2/3 and 1/3 elements in one row where the content is in fixed container but the background colors goes to the outer border of the viewport.Is there a way to create a two-column grid-row. Set the content and the split to the container width (it is 1340px) but have the background colors stretch to fullscreen viewport?
Thanks.
JNovember 5, 2020 at 1:29 pm #1258600Take the grid-row element and set your 2/3 – 1/3 grid cell settings – one of those paddings had to be in relation to screen width
you had to set a calculated relative padding left or right ( depends if your 2/3 grid cell is on the left or right ) – and only set the rules for screen-width less than 1400px ( your 1340px + 2x30px (if this is the alb padding setting ) case if you like to preserve a left / right padding of your alb setting ( in my case 30px )
on responsive case Enfold has its own rules for padding.@media only screen and (min-width: 1400px) { /*** it depends on your setting on the alb - i got 30px on all sides : 1340px + 60px ***/ .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1340px)/2) !important; } .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1340px)/2) !important; } .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1340px)/2) !important; } .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1340px)/2) !important; } }
these rules can be used for all grid-cell sizes because only the first and last are selected!
See example page with 1/2 grid-cell size – but it is the same rules as above ( i have 1510px standard setting for content)
https://webers-testseite.de/grid-row-layout/November 5, 2020 at 3:01 pm #1258615Hi Guenni007,
Thanks for the suggestion. It works perfectly for 1/2 1/2 grid cells because the split is in the center of VW.
But it is not great for 2/3 1/3. The wider the VW gets, the smaller is the space for content in the 1/3 cell (or the last cell).November 5, 2020 at 4:05 pm #1258637for my setting 1510px and 50px setting on Grid-Cell padding overall:
( Sorry this for my page id specific – remove it or replace it to your IDs – or even better give to the grid-row a custom-class )@media only screen and (min-width: 1510px) { .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1510px)/2 + 50px) !important; } .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1510px)/2 + 50px) !important; } .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1510px)/2 + 50px) !important; } .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1510px)/2 + 50px) !important; } } @media only screen and (max-width: 1509px) { .flex_cell.avia-builder-el-first { padding-left: 50px !important; } .flex_cell.avia-builder-el-first { padding-left: 50px !important; } .flex_cell.avia-builder-el-last { padding-right: 50px !important; } .flex_cell.avia-builder-el-last { padding-right: 50px !important; } }
see: https://webers-testseite.de/grid-row-layout/
the 1/1 Container shows you the standard of 1510px width on my setting.
- This reply was modified 4 years ago by Guenni007.
November 5, 2020 at 4:19 pm #1258645Thanks again for your reply.
Yes your solution works, but as the viewport gets wider the image in the last 1/3 cell gets smaller.
I am interested in keeping the proportions between the content in the row.Your suggestion keeps the content within the container width, but the 2/3 1/3 proportion is changing to the window width
and the split between the cells move according to size of VW so I could end up with a 9/10 1/10 proportion in the container on a large screen.Does it make any sense?
- This reply was modified 4 years ago by roeraskholm.
November 5, 2020 at 4:23 pm #1258648see now with new css above:
https://webers-testseite.de/grid-again/November 5, 2020 at 4:27 pm #1258650with custom-class on grid-row element : gridcontent-special
@media only screen and (min-width: 1510px) { .gridcontent-special .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1510px)/2 + 50px) !important; } .gridcontent-special .flex_cell.avia-builder-el-first { padding-left: calc((100vw - 1510px)/2 + 50px) !important; } .gridcontent-special .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1510px)/2 + 50px) !important; } .gridcontent-special .flex_cell.avia-builder-el-last { padding-right: calc((100vw - 1510px)/2 + 50px) !important; } } @media only screen and (max-width: 1509px) { .gridcontent-special .flex_cell.avia-builder-el-first { padding-left: 50px !important; } .gridcontent-special .flex_cell.avia-builder-el-first { padding-left: 50px !important; } .gridcontent-special .flex_cell.avia-builder-el-last { padding-right: 50px !important; } .gridcontent-special .flex_cell.avia-builder-el-last { padding-right: 50px !important; } }
November 5, 2020 at 4:31 pm #1258652and for the breakpoint for responsive case ( in my case it is 990px ):
@media only screen and (max-width: 989px) { .gridcontent-special .flex_cell { padding-left: 50px !important; } .gridcontent-special .flex_cell { padding-right: 50px !important; } }
November 5, 2020 at 11:08 pm #1258750Hi roeraskholm,
Did you get it working with Guenni007’s suggestions or do you need more help on this one?
Best regards,
VictoriaNovember 6, 2020 at 11:16 am #1258820Hi Victoria,
Guenni007’s suggestions are not exactly what I need. But it is very close to.
I am trying to create this: https://www.dropbox.com/s/49zz0x4ihqkr7xy/example01.png?dl=0
The problem with the suggestions above is, that as the VW is widening, the proportion between the two cells skew in the container.
This is because the 2/3 1/3 proportion is always calculated on the VW but the content is being fit to the container which is centered in the VW.
I am looking for a solution where the proportion in the container is constantly 2/3 1/3 and only the cell-color goes to the edge.Thanks.
November 9, 2020 at 6:19 pm #1259321Hi roeraskholm,
Can you show us what you’ve got so far?
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaNovember 9, 2020 at 6:49 pm #1259333Hi Victoria,
Sure. Here is the page I am testing on right now: https://teologistudiet.dk/test/
The first three rows are regular sections 2/3 and 1/3
The second three rows are grid 2/3 1/3
The last three are grid 1/2 1/2What I wish to achieve is the look and proportions of the first three rows, but the background color should go to the edge of the VW.
Thanks.
November 9, 2020 at 9:08 pm #1259395Hi roeraskholm,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
#top.page-id-701 #av_section_1 .container { max-width: 100vw; } #top.page-id-701 #av_section_1 .avia-builder-el-6 .avia-image-container { margin-left: 150px; } #top.page-id-701 #av_section_1 .avia-builder-el-14 .avia-image-container, #top.page-id-701 #av_section_1 .avia-builder-el-4 .avia-image-container { margin-right: 150px; }
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.