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 trialammarkhan
Front End Web Development Techdegree Student 21,661 PointsTransition not smooth
I have following css , but my input doesn't get smooth transition.
*{
background: #2980B9;
}
input[type="text"]{
background:#3498DB;
padding:5px;
border:0;
border-radius: 0.5em;
transition-property: background;
transition-delay:5s;
}
input[type="text"]:focus{
background: #2C3E50;
}
1 Answer
Jesus Mendoza
23,289 PointsHey Ammar.
You need to specify the duration
transition-duration: .5s;
You can shorten your properties to one line
transition: background 5s .5s;
ammarkhan
Front End Web Development Techdegree Student 21,661 Pointsammarkhan
Front End Web Development Techdegree Student 21,661 PointsJesus Mendoza why use
css 5s .5s
`Jesus Mendoza
23,289 PointsJesus Mendoza
23,289 PointsWriting
transition: background 5s .5s;
is the same as
but in only one line of code.