Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
pgmd
6,897 PointsTransition
in one of the classes I saw the following. The The guy on teh video ads a transition to main-nav li. I tried it on main-nav li:hover:not (and commented it out) and it works as well. Why did he choose to add it to main-nav li? Also, flex-grow: 1 does not seem to do anything!!!:
.main-nav li {
margin-left: 8px;
margin-right: 8px;
-webkit-align-self: center;
align-self: center;
-webkit-flex-grow: 1;
flex-grow: 1;
/* transition: .5s; (commented out for testing */
}
.main-nav li:hover:not(.main-logo) {
flex-grow: 2;
transition: .5s;
}
1 Answer
Phillip Gibson
13,805 PointsAdding it on the non hover state will have it transition both in and out.
For example, check out this link to see how the box will change from red to green once you hover. However, once you move the mouse out of the box, it will "jump" straight back to red.
If you move the transition out of the hover selector, it will fade both in and out.