# Flexbox Fundamentals
_by Garth Braithwaite_

![](https://d2eip9sf3oo6c2.cloudfront.net/series/square_covers/000/000/036/full/EGH_Flexbox.png?1496436393)

Flexbox is a wonderful tool built into the CSS specification. Using flexbox doesn't require any special framework or library, just a browser with CSS3 support. It is so awesome, and makes the arranging elements on a page almost fun!

_Each lesson's code is in its corresponding lesson folder. Plunks are drawn from the lesson's branch._
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Flexbox Alignment</title>
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="lib/app.css">
</head>
<body>
  <article class="fake-article">
    <header>
      <h1>Fake Article</h1>
    </header>
    <p>Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla.</p>
  </article>
  <article class="not-real">
    <header>
      <h1>Not Real</h1>
    </header>
    <p>Nullam quis risus eget urna mollis ornare vel eu leo. Etiam porta sem malesuada magna mollis euismod.</p>
  </article>
  <article class="phoney">
    <header>
      <h1>Phoney</h1>
    </header>
    <p>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
  </article>
</body>
</html>
:root {
  height: 100%;
}
body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  min-height: 100%;
  background: #333;
}
h1 {
  font-weight: 600;
  margin: 0 0 5px 0;
}
p {
  margin: 5px 0;
}
article {
  box-sizing: border-box;
  background: #FFF;
  margin: 5px;
  flex: 1;
}
body {
  display: flex;
  flex-direction: row;
  align-items: baseline;
}
.not-real {
  align-self: flex-end;
}