We help IT Professionals succeed at work.
Get Started

CSS3 - transitions

jensjakobsen
jensjakobsen asked
on
1,104 Views
Last Modified: 2012-08-01
Hi

I have created a very simple HTML page with some very simple CSS3 properties in it.

Basically I want the page to act and perform like it does in Mozilla Firefox/Safari - but for some reason Chrome stands out.

Please take a look at http://bitspand.dk/csstest.html

When loading the page in these browsers - this is what happens:

Safari, Firefox: Loading the page shows no animation. Only when I hover the mouse over the black area with the text, then a transition comes alive - just like I want it.

Chrome: Loading the page starts with an animation - where the black area slides in from left to bottom, and then waits for the user to hover their mouse over the black area.

I DON'T WANT THE ANIMATION WHEN THE PAGE LOADS :(

Here is my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/csstest.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="transition">
<div class="content">
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
<div class="contentTXT">Halloje - dette er en test</div>
</div>
</div>

</body>
</html>

Open in new window


Here is my CSS code:
@charset "utf-8";
/* CSS Document */

.transition {
	z-index: 1;
	background-color: #ffffff;
	background-image:url(../images/CRW_2063.jpg);
	float: left;
	height: 450px;
	width: 700px;
	position: relative;
	overflow:hidden;
}

.content {
	z-index: 2;
	position: relative;
	height: 450px;
	width: 700px;
	top: 350px;
	background-color: #000;
	opacity: 0.6;
	filter: alpha(opacity = 60);
	overflow: hidden;
	-webkit-transition: all 1s linear 0.5s;
	-moz-transition: all 1s linear 0.5s;
	-ms-transition: all 1s linear 0.5s;
	-o-transition: all 1s linear 0.5s;
	transition: all 1s linear 0.5s;
}

.contentTXT {
	position:relative;
	float:left;
	width:700px;
	height:50px;
	font-family: Arial;
	font-size: 30px;
	font-color: #FFF;
	z-index: 3;
	text-align: center;
	vertical-align: central;
	color: #FFF;
}
.content:hover {
	top: 0px;
	bottom: 0px;
}

Open in new window

Comment
Watch Question
Data Scientist
Most Valuable Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE