I have two containers: left
and right
. left
contains text in it's top and buttons in it's bottom; right
contains other components, centered.
right
' height is always higher than left
's, but I don't neither right
's nor left
's heights. I want to align the start of the text of left
with the start of right
and the left
's buttons with the right
's end. In order to do so, I'm trying to make both of them the same height, but I'm failing at that.
This is the visual effect I would like to have:
Here's an example code:
<div id="parent" className="flex items-center justify-center vh-100 w-100">
<div id="left" className="flex flex-column justify-between">
<Text />
<Buttons />
</div>
<div id="right" className="flex items-center justify-center">
<TallStuff />
</div>
</div>
I'm using Tachyon's classes to illustrate.
I have already tried to use flex: 1
, flex-grow
, align-items: stretch
, height: 100%
and others on left
to no avail.
I'm rewriting to make my situation clearer. I hope this help you guys to help me.
I have this screen where a user can click in a book and see info about it:
The books are gotten through a third-party API, so I never know exacly how big they are. And since this screen is yet on development I don't know if the column to the right will always be like they are now.
When things go wrong (i.e., the text is too small) I got something like this:
Where I would like something more like this:
This is the code for the screen you see:
<div className="flex h-100 items-center w-100">
<section className="pt3 w-40">
<Card
authors={authors}
cover={cover}
date={date}
plataforms={plataforms}
synopsis={synopsis}
title={title}
/>
</section>
<section className="flex flex-column items-center justify-center w-60">
<BookCarousel books={data} title="main feeling" />
<BookCarousel books={data} title="main feeling" />
</section>
</div>
This is the JSX of the <Card>
component:
<article class="flex flex-column items-center justify-between pl3 pr3">
<section>
<Cover alt={title} src={cover} className="fl mr3" />
<h2 className="di f5 ma0">{title}</h2><br/>
{signature}<br/><br/>
{summary}
</section>
<section className="flex">
// buttons
</section>
</article>
It's written with React. (CSS still is Tachyons)