Skip to content

Commit be70b70

Browse files
authored
Merge pull request #13 from npranto/fb
adds flex example
2 parents 0f1ceab + 795c421 commit be70b70

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,10 @@ A guide to understanding flexbox in depth with practical examples
8989
+ [flex-basis: auto](http://understanding-flexbox.surge.sh/#flex-basis-auto)
9090
+ [flex-basis: 50%](http://understanding-flexbox.surge.sh/#flex-basis-50-percentage)
9191
+ [flex-basis: 100px](http://understanding-flexbox.surge.sh/#flex-basis-100-pixels)
92+
93+
#### flex
94+
+ a shorthand for flex-shrink, flex-grow and flex-basis all together
95+
+ an simple example could be `flex: 0 1 auto`, 0 is flex-grow, 1 is flex-shrink, and auto is flex-basis
96+
+ `flex`property values:
97+
+ [flex: 0 1 150px](http://understanding-flexbox.surge.sh/#flex)
98+

src/index.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,54 @@ <h2 class="header red">
17081708
}
17091709
.thirty-four li {
17101710
flex-basis: 100px;
1711+
}
1712+
<!--code-->
1713+
</pre>
1714+
</code>
1715+
</section>
1716+
</article>
1717+
</details>
1718+
</div>
1719+
1720+
<h2 style="font-family: AppleGothic; color: dimgray; text-align: center"> Flex </h2>
1721+
<div class="container">
1722+
<a name="flex"></a>
1723+
<h2 class="header red">
1724+
<code>
1725+
flex: 0 1 150px;
1726+
</code>
1727+
</h2>
1728+
<!--code-->
1729+
<ul class="thirty-five">
1730+
<li class="item"> coffee </li>
1731+
<li class="item"> is coffee better than tea? </li>
1732+
<li class="item">
1733+
Remember how I said the beauty
1734+
of the flex-items is being
1735+
“flexible”? Well, it appears
1736+
you also have a control over
1737+
that.
1738+
</li>
1739+
</ul>
1740+
<!--code-->
1741+
<br>
1742+
<details>
1743+
<summary> <b> Source Code </b> </summary>
1744+
<article class="source-code">
1745+
<section class="html">
1746+
<!--code-->
1747+
<pre>&lt;ul class="thirty-five"&gt;<br /> &lt;li class="item"&gt; coffee &lt;/li&gt;<br /> &lt;li class="item"&gt; is coffee better than tea? &lt;/li&gt;<br /> &lt;li class="item"&gt;<br /> Remember how I said the beauty<br /> of the flex-items is being<br /> &ldquo;flexible&rdquo;? Well, it appears<br /> you also have a control over<br /> that.<br /> &lt;/li&gt;<br />&lt;/ul&gt;</pre>
1748+
<!--code-->
1749+
</section>
1750+
<section class="css">
1751+
<code>
1752+
<pre>
1753+
<!--code-->
1754+
.thirty-five {
1755+
display: flex;
1756+
}
1757+
.thirty-five li {
1758+
flex: 0 1 150px;
17111759
}
17121760
<!--code-->
17131761
</pre>

src/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,12 @@ li {
289289
}
290290
.thirty-four li {
291291
flex-basis: 100px;
292+
}
293+
294+
/*----- thirty-five -----*/
295+
.thirty-five {
296+
display: flex;
297+
}
298+
.thirty-five li {
299+
flex: 0 1 150px;
292300
}

0 commit comments

Comments
 (0)