Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1298850

    Hi Kriesi

    I am building a page see private link.
    The rows are alternate so go like this
    2/5+1/5+1/5+1/5
    Next row 1/5+1/5+1/5+2/5 [this row needs to flex]
    And so on
    Each 2/5 text box needs to be first on mobile view.
    How can I use flex styling to get this to work please?
    It seems your rows are now delineated into rows but it is just columns so I have put a divider between each. If we use flex styling how should I delineate between the rows.
    Many thanks, Helen

    #1299173

    Hey helban,
    Thank you for your patience and the link to your page, with the way that flex works with row or column reverse, or even order, the rows you are creating need to be wrapped in a container so the inner elements can be ordered or reversed. For this reason, we have the Grid Row element, to use this in your situation you would add the Grid Row and 4 cells:
    grid_row_element_with_4_cells.jpg
    and then use the Set Cell Size option to set your 2/5+1/5+1/5+1/5
    grid_row_element_set_cell_size.jpg
    and then add your inner cell content
    grid_row_element_with_inner_content.jpg
    for this example I will clone the Grid Row 3 times and use the Set Cell Size option to alternate the rows for desktop as in your example 1/5+1/5+1/5+2/5, then for the mobile css it will be easier to add custom IDs to each of the Grid Rows in the Advanced Tab > Developer Settings
    grid_row_element_add_custom_id.jpg
    I recommend using lower case letters only and each ID must be different and unique to your whole site, for this example I’m using one, two, three.
    3_alternate_grid_rows_desktop.jpg
    Then for the mobile flex column reverse of this one row you would use this css in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    @media only screen and (max-width: 767px) { 
      #two {
        display: flex;
        flex-direction: column-reverse;
      }
      }

    3_alternate_grid_rows_mobile_before_and_after_flex_css.jpg
    I hope this helps.

    Best regards,
    Mike

    #1299200

    in addition to that above – you can even set an order number for responsive case:
    https://css-tricks.com/snippets/css/a-guide-to-flexbox/ : see on the right side there are the flex-item properties.

    #1299531

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

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