Skip to content

Instantly share code, notes, and snippets.

@kizu
Forked from alexeyten/dabblet.css
Created July 17, 2014 12:01
Show Gist options
  • Save kizu/26d0bfb6de57abb08d27 to your computer and use it in GitHub Desktop.
Save kizu/26d0bfb6de57abb08d27 to your computer and use it in GitHub Desktop.
Align
/**
* Align
*/
flex {
display: flex;
align-items: baseline;
}
div {
width: 5em;
border: 1px solid black;
margin: 0 2px;
}
p {
display: inline-block;
width: 100%;
margin: 0;
background: red;
}
p + p {
background: green;
}
p + p + p {
background: blue;
}
<flex>
<div>
<p style="padding-bottom: 10px;">one</p>
<p>one<br>two<br>three</p>
<p>one<br>two</p>
</div>
<div>
<p style="padding-bottom: 20px;">one<br>two<br>three</p>
<p>one<br>two</p>
<p>one</p>
</div>
<div>
<p style="padding-bottom: 30px;">one<br>two</p>
<p>one</p>
<p>one<br>two<br>three</p>
</div>
</flex>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment