Solved

Unsmooth CSS transition question

Posted on 2014-11-15
2
119 Views
Last Modified: 2014-11-15
When I hover my mouse over the gray div area, the initial expansion is a very quick jerk. But it slowly decreases in size after a mouseout. My objective is to achieve a smooth transition both ways, i.e., expansion and collapse. Can anyone please tell me what I'm lacking with my code? Thanks.

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
div {
	background: rgba(220,216,216,1.00);
	width: 400px;
	height: 295px;
	margin: 0 auto;
	overflow: hidden;
	transition: all 2s ease;
}
div:hover {
	height: 100%;
}
</style>
</head>

<body>
	<div>
    	This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box. This is an expanding div box.  
    </div>
</body>
</html>

Open in new window

0
Comment
Question by:elepil
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40445122
Don't use 100% - use a set height for the hover.
0
 

Author Closing Comment

by:elepil
ID: 40445128
THANKS!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now