This is the kind of placement I would like to achieve with display:flex
. I want the text1
to appear at the top, text3
at the bottom and text2
in the middle.
However the end result I got is this:
I am expecting align-self
to be able to pull the top and the bottom div
toward each end.
What did I miss?
Here is my html mark-up and css stylesheet
HTML:
<div class=container>
<div class='logo-container hidden-xs'>
<span>LOGO on the side</span>
</div>
<div class='text-container' >
<div class='visible-xs'>
<span>LOGO</span>
</div>
<div class=text1>
Text1
</div>
<div class=text2>
Text 2
</div>
<div class=text3>
Text 3
</div>
</div>
</div>
css:
.container {
display: flex;
/* flex-direction: row; no effect */
border: 1px;
border-style: solid;
height: 300px;
}
.container span {
padding: 5px;
border: 1px;
border-style: solid;
border-color: blue;
}
.text-container {
flex-direction: column;
border: 1px;
border-style: solid;
border-color: red;
}
.do-i-need-this {
display: flex;
flex-direction: row;
}
.text1 {
align-self: flex-start;
border: 1px;
border-style: solid;
border-color: green;
}
.text2 {
border: 1px;
border-style: solid;
border-color: green;
}
.text3 {
align-self: flex-end;
border: 1px;
border-style: solid;
border-color: green;
}