Skip to content

Commit b141ad6

Browse files
committed
added example for transition
1 parent fceafbc commit b141ad6

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

css.html

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@
5353
border: 2px solid gray;
5454
margin:5px;
5555
}
56+
.element{
57+
height: 50px;
58+
width: 50px;
59+
transition: width 2s linear 0.5s;
60+
background-color: purple;
61+
}
62+
.element:hover {
63+
width: 100px;
64+
}
5665
</style>
5766

5867
<!-- Just for debugging purposes. Don't actually copy this line! -->
@@ -64,7 +73,7 @@
6473
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
6574
<![endif]-->
6675
</head>
67-
76+
6877
<body>
6978

7079
<!-- Main jumbotron for a primary marketing message or call to action -->
@@ -216,9 +225,27 @@ <h2>9. shadow DOM</h2>
216225
<div id="semantic_html">
217226
<h2>10. transition</h2>
218227
<p><strong>Question:</strong> What do u know about tranisition 3D?</p>
219-
<p><strong>Answer:</strong> .</p>
220-
221-
<p>ref: <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>
228+
<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>
229+
<div>
230+
<button id = "transition" type="button" class="toggleExample btn btn-primary">show example</button>
231+
<div id="transitionExample" class="hide">
232+
<pre><code>
233+
.transition {
234+
transition: [transition-property] [transition-duration] [transition-timing-function] [transition-delay];
235+
}
236+
.element {
237+
width: 50px;
238+
transition: width 2s ease 0.5s;
239+
}
240+
241+
.element:hover {
242+
width: 100px;
243+
}
244+
</code></pre>
245+
<div class="element"></div>
246+
</div>
247+
</div>
248+
<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>
222249
</div>
223250
<div id="mtuli_lang">
224251
<h2>11. pre processor</h2>

0 commit comments

Comments
 (0)