How make article background ease in with CSS3?

Vildbas

New Member
My first thread!

I want my <article> to slightly get a white background when being hovered. Think it's called a transition? I've tried this in CSS3 without result:

HTML:
article:hover {
	moz-transition:background-color 2s linear;
	webkit-transition:background-color 2s linear;
	background:rgba(255,255,255,1);
	padding:5px;
	margin:10px;
	-webkit-border-radius:20px;
	-moz-border-radius:20px;

The background just gets white instantly. Why? :eek:

/Emil, Sweden
 

Phreaddee

Super Moderator
Staff member
You need to tell its start point and endpoint, and your opacity it at 1, so yes it shoulf be white instantly.
 

Vildbas

New Member
So what exactly should i write?

I'm kind of new to CSS so excuse me for not "reading in between the lines":D
 

Vildbas

New Member
I did it myself. Forgot the "-"'s before moz and webkit :)

HTML:
        article {
	background:rgba(255,255,255,0);
	padding:5px;
	margin:10px;
	-webkit-border-radius:20px;
	-moz-border-radius:20px;
	-moz-transition:background-color 2s linear;
	-webkit-transition:background-color 2s linear;
}


article:hover {

	background-color:rgba(255,255,255,1);
	
}

Easy as a pancake!
 
Top