Skip to content

Commit 341d62a

Browse files
committed
upgraded transition example
1 parent 351da68 commit 341d62a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

css.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@
5656
.element{
5757
height: 50px;
5858
width: 50px;
59-
transition: width 2s linear 0.5s;
59+
transition: width 2s linear 0.5s, background-color 2s linear 0.5s;
6060
background-color: purple;
6161
}
6262
.element:hover {
6363
width: 100px;
64+
background-color: red;
6465
}
6566
</style>
6667

@@ -201,6 +202,7 @@ <h2>5. position</h2>
201202
<h2>6. display vs visibility</h2>
202203
<p><strong>Question:</strong> What are the differences between visibility hidden and display none?</p>
203204
<p><strong>Answer:</strong> <code>display:none</code> removes the element from the normal layout flow and allow other elements to fill in. <code>visibility:hidden</code> tag is rendered, it takes space in the normal flow but hides it.</p>
205+
<p>if u want to say it smartly, <code>display:none</code> cuases DOM reflow where is <code>visibility:hidden</code> doesn't. btw, what is reflow? answer. sorry i wont tell you, google it.</p>
204206
<p>ref: <a href="http://www.vanseodesign.com/css/visibility-vs-display/">visibility vs Display</a></p>
205207
</div>
206208
<div id="http_request">
@@ -233,7 +235,7 @@ <h2>9. shadow DOM</h2>
233235
<div id="semantic_html">
234236
<h2>10. transition</h2>
235237
<p><strong>Question:</strong> What do u know about tranisition 3D?</p>
236-
<p><strong>Answer:</strong> transition allows to add an effect while changing from one style to another. You can set the which property you want to transition, duration, how u want to transit (linear, ease, ease-in, ease-out, cubic-bezier) and delay when transition will start.</p>
238+
<p><strong>Answer:</strong> transition allows to add an effect while changing from one style to another. You can set the which property you want to transition, duration, how u want to transit (linear, ease, ease-in, ease-out, cubic-bezier) and delay when transition will start. you can transition more than one property by comma seperation</p>
237239
<div>
238240
<button id = "transition" type="button" class="toggleExample btn btn-primary">show example</button>
239241
<div id="transitionExample" class="hide">
@@ -243,17 +245,22 @@ <h2>10. transition</h2>
243245
}
244246
.element {
245247
width: 50px;
246-
transition: width 2s ease 0.5s;
248+
background-color:purple;
249+
transition: width 2s linear 0.5s, background-color 2s linear 0.5s;
247250
}
248251

249252
.element:hover {
250253
width: 100px;
254+
background-color:red;
251255
}
252256
</code></pre>
257+
<p>Hover over the purple box and wait.</p>
253258
<div class="element"></div>
259+
<p><strong>Advanced:</strong> you can check transfrom: <a href="http://www.sitepoint.com/advanced-css3-2d-and-3d-transform-techniques/">css 2D 3D transform</a>, <a href="http://css3.bradshawenterprises.com/flip/">flip an image</a></p>
254260
</div>
255261
</div>
256-
<p>ref: <a href="http://blog.alexmaccaw.com/css-transitions">all you need to know about css transition</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions">css transition</a> <a href="http://www.html5rocks.com/en/tutorials/3d/css/">transition and 3D</a></p>
262+
<p>ref: <a href="http://blog.alexmaccaw.com/css-transitions">all you need to know about css transition</a>, <a href="http://css3.bradshawenterprises.com/transitions/">transition: tutorial</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transitions">css transition</a>, <a href="http://www.html5rocks.com/en/tutorials/3d/css/">transition and 3D</a></p>
263+
257264
</div>
258265
<div id="mtuli_lang">
259266
<h2>11. pre processor</h2>

0 commit comments

Comments
 (0)