Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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.
    J

    #1258600

    Take 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/

    #1258615

    Hi 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).

    #1258637

    for 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.
    #1258645

    Thanks 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?

    #1258648

    see now with new css above:
    https://webers-testseite.de/grid-again/

    #1258650

    with 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;
      }
    }
    #1258652

    and 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;
      }  
    }
    #1258750

    Hi roeraskholm,

    Did you get it working with Guenni007’s suggestions or do you need more help on this one?

    Best regards,
    Victoria

    #1258820

    Hi 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.

    #1259321

    Hi 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,
    Victoria

    #1259333

    Hi 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/2

    What 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.

    #1259395

    Hi 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

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.