Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Contextually aware equal height rows flexbox

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #269723
    h0rhay
    Participant

    Is there a way to achieve this?

    I’ve been playing with CSS Tricks original article on this here:
    https://css-tricks.com/boxes-fill-height-dont-squish/

    Trying to make Row Three (or all rows) equal height in both columns here:
    https://codepen.io/h0rhay/pen/EEJLPp

    Wondering if its possible without resorting to JS?

    What d’yall think :)

    #269724
    Mamun
    Participant

    Did you want something like this?

    https://codepen.io/kh-mamun/pen/zWXaKO

    I used grid here. I think you can do it with flexbox also.

    #269725
    h0rhay
    Participant

    Nice job @kh-mamun .. kind of looking for a flexbox solution, but not sure its possible with flexbox?

    #269726
    Paulie_D
    Member

    No, this is not possible in flexbox given the structure you have (vertical columns).

    Flexbox (and pretty much any other layout method) does not have any method of equalising heights between elements that do not share a common parent.

    #269727
    Omwati6229
    Participant

    It is nice may calendar 2018
     http://may2018calendar.net

    #269728
    Pogany
    Participant

    Is it possible to change your HTML or it has to stay as it is?

    #269729
    h0rhay
    Participant

    We could change markup..

    The goal is to have a grid of tiles that are always the same height (depending on the content), and each internal row on each tile aligns up horizontally.

    #269731
    Mamun
    Participant

    It’s flex based. See if it server the purpose.

    https://codepen.io/kh-mamun/pen/QmPZaJ

    #269736
    h0rhay
    Participant

    I like it @kh-mamun, but we still need to markup our tiles as individual tiles due to react architecture.
    Nice solution though :)

    Re: the initial problem.. still not sure its solvable with flex

    #269738
    Mamun
    Participant

    I think I didn’t understand your problem. What is the actual problem? I thought you wanted rows to be equal height. Can you explain what is the problem and what solution are you looking for? This can be achieved with few other ways I guess. I might not be able to solve it but at least let me know with detailed explanation. Let’s try it…

    #269739
    h0rhay
    Participant

    From above:

    The goal is to have a grid of tiles that are always the same height (depending on the content), and each internal row on each tile aligns up horizontally.

    So we have the markup as in the original pen.. each tile is wrapped in its own wrapping div or li, the probelem comes when trying to align items horizontally, and the tiles should be ‘contextually’ aware of the one next to it, so that the rows are aligned, no matter what the content.

    Thanks for the interest :)

    The only solution we have arrived at, is to have fixed item content pinned to the top and or bottom, and then let items in the middle flex-grow.

    #269741
    Mamun
    Participant

    If each tile has it’s own wrapper div then you can’t relate left elements with right elements only with css. You need javascript for that. CSS is not that strong yet.

    #269760
    h0rhay
    Participant

    Yep, thats the conclusion we came to.
    Was hoping flexbox might be a solution but yes only JS or Grid can accomplish it.
    Thanks for looking into it :)

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘CSS’ is closed to new topics and replies.