Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 35 additions & 29 deletions flex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,47 @@
<html>

<head>
<title>Align Items</title>
<link href='style.css' rel='stylesheet'/>
<title>Flex Grow and Shrink</title>
<link href='style.css' rel='stylesheet' />
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet'>
</head>

<body>
<h1>Flex Start</h1>
<div class='container' id='flexstart'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
<h1>Step 1</h1>
<div id='top'>
<div class='top side'>
<h2>1</h2>
</div>
<div class='top center'>
<h2>2</h2>
</div>
<div class='top side'>
<h2>3</h2>
</div>
</div>
<h1>Flex End</h1>
<div class='container' id='flexend'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
<h1>Step 2</h1>
<div id='middle'>
<div class='middle side'>
<h2>1</h2>
</div>
<div class='middle center'>
<h2>2</h2>
</div>
<div class='middle side'>
<h2>3</h2>
</div>
</div>
<h1>Center</h1>
<div class='container' id='center'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
</div>
<h1>Baseline</h1>
<div class='container' id='baseline'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
</div>
<h1>Stretch</h1>
<div class='container' id='stretch'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
<h1>Step 3</h1>
<div id='bottom'>
<div class='bottom side'>
<h2>1</h2>
</div>
<div class='bottom center'>
<h2>2</h2>
</div>
<div class='bottom side'>
<h2>3</h2>
</div>
</div>
</body>

Expand Down
63 changes: 39 additions & 24 deletions flex/style.css
Original file line number Diff line number Diff line change
@@ -1,47 +1,62 @@
body {
margin: 0;
border: 0;
font-family: 'Roboto Mono', monospace;
}

h1 {
margin: 20px;
text-align: center;
font-size: 18px;
}

.container {
height: 150px;
background-color: whitesmoke;
display: flex;
justify-content: center;
h2 {
font-size: 16px;
}

h1,
h2 {
text-align: center;
}

.left,
.center,
.right {
min-height: 75px;
width: 125px;
.top,
.middle,
.bottom {
width: 100px;
height: 100px;
background-color: dodgerblue;
border: 2px solid lightgrey;
margin: 10px 30px;
}

#baseline .center {
height: 100px;
width: 100px;
border: 5px solid turquoise;
.top.side {
flex-grow: 1;
}

#flexstart {
align-items: flex-start;
.top.center {
flex-grow: 1;
}

#flexend {
align-items: flex-end;
.middle.side {

}

#center {
align-items: center;
.middle.center {

}

.bottom.side {

}

#baseline {
align-items: baseline;
.bottom.center {

}

#top,
#middle,
#bottom {
display: flex;
background-color: Whitesmoke;
justify-content: center;
min-height: 200px;
align-items: center;
}