Solved

Unsmooth CSS transition question

Posted on 2014-11-15
2
124 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Else condition 9 23
Add shadow behind div 5 25
Fix a css menu for width 15 23
html / css issue / div issue. stuck, help needed 2 16
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

830 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