Grow your business, income, & life

20+ yrs of experience to offer you education and business services that launch and grow your business

CSS3 Tutorial for Beginners: 41 Image Transition Effect

This is Sasha and welcome to another CSS training video where I share with you how to edit and modify your business website when it comes to the CSS or if you’re learning CSS, thanks for joining me, in either case. Today, what I want to do is take a look at the transition-property and how to make things ease-in and ease-out with a soft effect. Let’s take a quick look.

If you take a look at the page here that I have, you have just a simple image right there, and I define that little width right there in the HTML so that way it’s not too large on the page and we can see transitions happening. Now, these transitions again very helpful for, let’s say easing things in and out on navigation menus. They’re great for pictures as well and just some additional special effects.

In either case, let me show you how this kind of works. Right now, what I have is a basic transition-property with width and what I’ve done is created right there a width of 400, and you can see as I roll over, it goes ahead and just creates that width of 400 which is not a big deal.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition-property: width;
}

img:hover {
	cursor: pointer;
	width:400px;
}


You could also include a height element in here if you like and then type in height over here and do something like 700 pixels. As you roll over, it’s just like a primary image roll over even without this transition-property. You can see it would still do the same thing. If I hit refresh, you can see it still does the same job.

At the moment, this really doesn’t do much for me. What is it that really starts making this happen or possible? Here’s the way that this kind of works and let me just show you what’s pretty cool about this. If you go to transition and you start seeing the variations that you could do, you could do transitions-duration.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition-property: width;
	transition-duration: 2s;
	transition-delay: 0s;
}

img:hover {
	cursor: pointer;
	width:400px;
}


What we can do is type in 2 seconds, you can also do things in milliseconds. If I do 900 ms which is almost 1 second, but in either case, I’ll do 2 seconds, it just takes up less space. I could do transition-delay which is how long it waits before that transition takes place and in that case, I could do, let’s say, 0 seconds for the time being. Let’s just see if this works out.

As I roll my mouse over, you can see how this affect scales of that picture on the width to 400. You can see how it really just eases right into it. Now if I do a delay of let’s give it a 3-second delay, I’m going to hit refresh and now watch. I’m holding the mouse, nothing is happening. There we go, after 3 seconds, there’s that delay. If I go off then again there’s a 3-second delay and then there it is. It goes back.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition-property: width;
	transition-duration: 2s;
	transition-delay: 3s;
}

img:hover {
	cursor: pointer;
	width:400px;
}


You could make this duration a lot longer if you want. You could make it 9 seconds. Let’s bump it down to 1 second delay, let’s hit refresh and let’s just roll our mouse over it and you can see how slow this transition really goes. You can see it’s going nice and slow, nice and slow and it takes its time of doing it.

In either case, this is a good way of really structuring your easing. Now, the other thing I want to mention is I’ve put these things in the comments as the transition-timing-function.

What’s interesting about the transition-timing is this timing function, you can have kind of different effects like ease-in, ease-out. I could say, “Okay. Well, this one let’s do ease-out.” Let’s just see what this does. I’ll go ahead, right now it’s easing in and let’s just see easing out, there you go. Sometimes what it does is it ramps things up first and then slows it down. Other times, it speeds it up and then slows it down towards the end of the curve. There’s also a linear version where it’s, you know, just linear.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition-property: width;
	transition-duration: 2s;
	transition-delay: 1s;
	transition-timing-function: ease-out;
}

img:hover {
	cursor: pointer;
	width:400px;
}


Typically, I don’t really play around with these, these are great for effects if you’re doing a lot of active things. You can see how this one is just straight at the same constant speed. For me, most of the time the way I write this code and we can do that shorthand property is you can go ahead and do things like, let’s just say, transition. There’s the shorthand, I do all, you might do half a second or even 1 second and then what you’ll do is just ease, okay? Let me just take a look and see if this works, make sure I have the coding right. I’ll go ahead and hit save and as I refresh, boom, there you go. That’s basically how I use it.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition: all 1s ease;
}

img:hover {
	cursor: pointer;
	width:400px;
}


In addition, the other way is I put in maybe the opacity of 0.5 which is good for like buttons and things like that. As you can see as I roll over, you know, you fade in right there. Even if we didn’t have the width, this just creates a really nice easing effect on a roll over. You could even do a 3 second if you want it a little bit slower. You could see how that works.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition: all 3s ease;
}

img:hover {
	cursor: pointer;
	opacity: .5;
}


Ultimately 1 to 2 seconds, you know, is pretty much all you need to create that nice little roll over effect rather than without that, you know, without that effect, you could see it just kind of – it’s a low effect. It just boom, lights switch on, light switch off whereas, with a 1 to 2-second easing, it gives you that little subtle feel right there which is, you know, a thousand milliseconds.

If you want to use the millisecond, ms command, you go 1,000 milliseconds, and you could do it that way, that gives you the same amount. But if you want to cut that and, let’s say, a little bit you could 400 milliseconds, speed it up a little bit where it’s kind of like a half second.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	transition: all 400ms ease;
}

img:hover {
	cursor: pointer;
	opacity: .5;
}


In either case, that’s how you use that property. One key point to keep in mind on this since this is fairly new CSS based code, you want to look at additional browsers. Here, for example, I’ll just paste these for you so you could see what they look like and uncomment them is basically Safari and internet explorer are some of the worst to handle it.

Internet explorer 10 right now does handle transition but you can see there’s the webkit-transition and webkit-delay, that’s the way you would write these in Safari. If you wanted to do it all shorthand, you would go something like this. This would affect pretty much three of four browsers.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	-webkit-transition: all 2s ease-out 2s;
	-moz-transition: all 2s ease-out 2s;
	-o-transition: all 2s ease-out 2s;
	transition: all 2s ease-out 2s;
}

img:hover {
	cursor: pointer;
	opacity: .5;
}


You can see webkit, this is the Safari version, and you have the Mozilla then I believe this one’s Opera and then finally the Google Chrome or most general browsers, and that’s why Google Chrome is one of the better or recommended versions to use when you do development works.

Anyways, if I save this right here, and let me just get rid of this last little bit of comment, so I’ll go ahead and hit refresh and make ’s only see here, transition all, let’s just do ease, okay, and doing the same thing, okay, this is all 2 seconds ease with a 2-second delay, okay?

Keep that in mind. That’s a 2-second delay so we’ll have to wait a second. One. Two. You should see it. There we go. If I go off 2-secodn delay, and again one, two. If I didn’t have that 2-second delay, I could make it 0 or just get rid of it, just to show you here what that looks like and now you can see as I do the mouse roll over, it works just fine.

--------------------- HTML CODE ------------------

		

	






--------------------- CSS CODE ------------------

img {
	cursor: pointer;
	-webkit-transition: all 2s ease;
	-moz-transition: all 2s ease;
	-o-transition: all 2s ease;
	transition: all 2s ease;
}

img:hover {
	cursor: pointer;
	opacity: .5;
}


Anyways, that’s how it works. It’s excellent for menu buttons if you have like a button or something like that, but it’s an excellent transition property. It makes things a little bit easier. There are other timings that you could do beyond ease because you can see I have ease-in, ease-out, step-start, step-end, I never did a step-start.

Let’s take a look at what step-start looks like just out of curiosity, and we can see but otherwise – okay, I don’t see any difference. In either case, there’s a lot of different ones and different effects that you could do with some research on if you cared about it or wanted to see it.

For my point of view, it’s – I just the easing function and that’s pretty much it. But it’s an excellent way to add a little nice subtle transition to your effects to roll overs or just any elements on your page.

Download our online toolbox for free! Simply click the get it now button below and see the must-have tools for online business owners!

Struggling to make your blog business profitable? Want to turn your hobby blog into an income-generating blog? Learn the right way to plan a highly successful and profitable blog business.

Learn how to create Pinterest Pins that are attractive, click-worthy, and make people want to click your Pins! Great skill to have to promote your content or make side-income designing Pinterest Pins for others.

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get MyOnline Business Toolbox
 

Had enough of the expensive and useless online business tools?

 

Stop wasting your money and time and get my list of awesome business tools.

 

Just enter your email address below so we know where to send it.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Video Gear Guide for YouTubers

Are you ready to improve your YouTube channel? If you want to see the best YouTube gear for YouTubers, then download my latest gear guide!

 

Enter your email below to get started...

FREE DOWNLOAD

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Wow! Get Ready to Start your Online Business Journey!

Just enter your email address below and be one of the fast growing online businesses roght now!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Create Videos that Convert Viewers into Buyers?

Are you tired of making videos that don't produce results?

 

Get my Video Formula cheat sheet and see how to create videos that get clicks and attracts buyers!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My Youtube Video Creation Checklist for FREE...
 

Overwhelmed by number of tasks that you need to do to make high-quality YouTube videos?

 

Then grab this YouTube Video Creation Checklist if a strategic procedure list for producing your YouTube videos.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

This is a List of the 125 Most Profitable YouTube Niches that might be a real eye-opener for you.


Sign up for FREE and gain some extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Profit from My 35 Local Strategies to Make Extra Money
 

Are you interested in making some money on the side? That don't need to be extra hard.

 

You can use My 35 Local Strategies to Make Extra Money and in seriously short time reap the benefits.

 

Grab this opportunity by entering your email below...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

FREE Guide to the Best Cameras for a Youtuber

Eager to find out which cameras are the top choices to producing and recording videos?

 

Grab my FREE Guide below by entering your email address... 

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

225 Profitable Pinterest Niches

Are you interested in learning which Pinterest niches are profitable?

 

Grab our FREE Pinterest Niche Guide by entering your email below

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

How to Get Started Selling Your Own Digital Products

Get my free mini-series by entering your email address below

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Find a Profitable Niche?

If you are interested in starting an online business and want to find the perfect niche to start making tons of money.

 

Then grab our FREE email series on how to find a highly profitable niche!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Get My Quick-Start Guide to Build Your Empire?

If you are interested in starting your own online business and making money online.

 

Then grab our quick email series on how to start a profitable business fast!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Learn How to Get Thousands of

Visitors to Your Website
 

This FREE email series will show you exactly how to get thousands of real visitors to your website even if you are an absolute beginner.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

5,000 SUBSCRIBERS

Derek will teach you simple tactics to attract life-long customers through real-world examples.

FOR FREE?

Want to learn how to get

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

Get my list of the 125 Most Profitable YouTube Niches. It will be an eye-opener for you!


Sign up for FREE and get extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

Get my list of the 125 Most Profitable YouTube Niches. It will be an eye-opener for you!


Sign up for FREE and get extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

don't call us.
we will coconut
you

organic pop up market store is heading your way​