-
-
Notifications
You must be signed in to change notification settings - Fork 240
CSS Transitions Tutorial #328
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -425,6 +425,61 @@ In our case, we only want to change the style of every odd row. Achieving that i | |
|
|
||
| > Try changing odd to even | ||
|
|
||
|
|
||
| ### Transitions | ||
|
|
||
| Let's take some **property** in our code and change it, making it somehow different. E.g. The `background` of the two links named **btn**, and let's change it on hover. This is a 'change'. Now we can have this affect take place during a number of seconds, this is a **Transition**. | ||
| Go ahead and add the selector to the stylesheet. | ||
|
|
||
| ```css | ||
| a.btn:hover { | ||
|
|
||
| [your property: your value;] | ||
|
|
||
| } | ||
| ``` | ||
|
|
||
| Add the **property** which we are chaning and its new value: | ||
|
|
||
| ```css | ||
| a.btn:hover { | ||
| background: black; | ||
| }``` | ||
|
|
||
| Now create a **Transition** affect: | ||
|
|
||
| ```css | ||
| a.btn:hover { | ||
| background: black; | ||
| transition-duration: 4s; | ||
| }``` | ||
|
|
||
| Create another one: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we amend this line saying that we are adding in the transition delay please? |
||
|
|
||
| ```css | ||
| a.btn:hover { | ||
| background: black; | ||
| transition-duration: 4s; | ||
| transition-delay: 1s; | ||
| }``` | ||
|
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove all these added extra lines please? |
||
|
|
||
|
|
||
| ## But before we end our lesson | ||
|
|
||
| ### RGB colors and opacity | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property already exists in the tutorial, could we say that we are going to go back and amend it rather than add it please?