Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds flex example #13

Merged
merged 1 commit into from
Sep 26, 2017
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,10 @@ A guide to understanding flexbox in depth with practical examples
+ [flex-basis: auto](http://understanding-flexbox.surge.sh/#flex-basis-auto)
+ [flex-basis: 50%](http://understanding-flexbox.surge.sh/#flex-basis-50-percentage)
+ [flex-basis: 100px](http://understanding-flexbox.surge.sh/#flex-basis-100-pixels)

#### flex
+ a shorthand for flex-shrink, flex-grow and flex-basis all together
+ an simple example could be `flex: 0 1 auto`, 0 is flex-grow, 1 is flex-shrink, and auto is flex-basis
+ `flex`property values:
+ [flex: 0 1 150px](http://understanding-flexbox.surge.sh/#flex)

48 changes: 48 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,54 @@ <h2 class="header red">
}
.thirty-four li {
flex-basis: 100px;
}
<!--code-->
</pre>
</code>
</section>
</article>
</details>
</div>

<h2 style="font-family: AppleGothic; color: dimgray; text-align: center"> Flex </h2>
<div class="container">
<a name="flex"></a>
<h2 class="header red">
<code>
flex: 0 1 150px;
</code>
</h2>
<!--code-->
<ul class="thirty-five">
<li class="item"> coffee </li>
<li class="item"> is coffee better than tea? </li>
<li class="item">
Remember how I said the beauty
of the flex-items is being
“flexible”? Well, it appears
you also have a control over
that.
</li>
</ul>
<!--code-->
<br>
<details>
<summary> <b> Source Code </b> </summary>
<article class="source-code">
<section class="html">
<!--code-->
<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>
<!--code-->
</section>
<section class="css">
<code>
<pre>
<!--code-->
.thirty-five {
display: flex;
}
.thirty-five li {
flex: 0 1 150px;
}
<!--code-->
</pre>
Expand Down
8 changes: 8 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,12 @@ li {
}
.thirty-four li {
flex-basis: 100px;
}

/*----- thirty-five -----*/
.thirty-five {
display: flex;
}
.thirty-five li {
flex: 0 1 150px;
}