Solved

Unsmooth CSS transition question

Posted on 2014-11-15
2
117 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
Comment Utility
Don't use 100% - use a set height for the hover.
0
 

Author Closing Comment

by:elepil
Comment Utility
THANKS!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

743 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

19 Experts available now in Live!

Get 1:1 Help Now