New Feature: Playlist Center! Pick a topic and let our playlists guide the way—like a learning mixtape.

Start learning with our library of video tutorials taught by experts. Get started

CSS: Transitions and Transforms
Illustration by

Setting up the HTML


From:

CSS: Transitions and Transforms

with Joseph Lowery

Video: Setting up the HTML

In this movie we're going to layout the HTML for our gallery. This will include the necessary structure to handle the 3D transforms, as well as the images themselves and the buttons in the control section. Let's start by opening the spotlight.htm file from the Chapter 05/05_02 folder in the exercise files in my code editor. Let's hit down to around line 36 where I've got a placeholder waiting. Insert carousel HTML here. Let's remove that so we can start coding. First, I'm going to add two sections using the appropriately named HTML 5 section tag.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
CSS: Transitions and Transforms
2h 25m Intermediate Jul 11, 2012

Viewers: in countries Watching now:

With robust and ever-increasing browser support, it is now possible to take advantage of expressive CSS3 capabilities across modern browsers. In this course, Joseph Lowery explores the possibilities of the new coding options, which animate well over 50 different properties automatically or interactively, and how they open the door to enhanced user experiences. This course covers the range from simple to complex transitions, including 2D and 3D transforms, and illustrates how transitions are expedited in various web authoring tools, as well as Dreamweaver. The course also contains a start-to-finish interactive slideshow project that allows you to practice and see the transitions and transforms immediately in action.

Topics include:
  • Understanding transition basics
  • Working with 2D and 3D transforms
  • Animating color changes
  • Fading objects
  • Changing the size of page elements and fonts
  • Transitioning multiple properties at the same time
  • Understanding keyframes and animations
  • Working in the z-index
  • Adding JavaScript interactivity
  • Crafting transitions in Dreamweaver
Subjects:
Web Web Design Web Development
Software:
CSS
Author:
Joseph Lowery

Setting up the HTML

In this movie we're going to layout the HTML for our gallery. This will include the necessary structure to handle the 3D transforms, as well as the images themselves and the buttons in the control section. Let's start by opening the spotlight.htm file from the Chapter 05/05_02 folder in the exercise files in my code editor. Let's hit down to around line 36 where I've got a placeholder waiting. Insert carousel HTML here. Let's remove that so we can start coding. First, I'm going to add two sections using the appropriately named HTML 5 section tag.

I'll give the first a class of container and then open up the section and make a little room, go past it, and let's put it in our second section. And this will have a class of options, and again I'll open that up. All right, now let's add a div within the first section to hold the carousel. This will give an ID of carousel, and let's open up that as well. Now we're ready to add in our figures. Each figure tag will have an identifying ID and contain an image tag.

These will all go within the div carousel. So I give this first figure an ID of fig1, and then move my cursor within the figure tag and put in my image tag, and this will have a source located within the _images folder, and it is artwork1. Next I'll give it a width of 274 and a height of 174. All of the images have the same width and height. Now they also share a common naming convention, artwork1, artwork2 and so forth, which makes putting in the remaining 9 images, a copy and paste affair.

So let's copy that line, so what I'm going to do is go ahead and paste in a line for each of the remaining images, and then come back and renumber them. That's my third one, four, five, six, seven, eight, nine, ten. fig1 goes to fig2. And artwork1 becomes artwork2. Let's do the same thing for the artwork. We'll change that to artwork3, and then press my down arrow and change the next to 4 and so on. All right, those are all done. Now we also need to add a class that will be used to identify this slide that is to be shown, which is used both to isolate the scale up hover effect and to enable the show on older browsers.

So I'm going to add that class to the very first figure. Since that's what we'll be showing when the page loads. And this is a class called ShowFig. All right, let's skip down to our options section and bring in our buttons. Again, we'll identify the elements with IDs. First I'm going to start with a paragraph tag with an ID of toggle. Within that paragraph tag I'll put in my button with an ID of toggle-axis. And within the button tag, the label itself, Toggle Axis.

Next, in this navigation section we'll also include a hidden input that will hold the panel count or the number of slides to show, and I'll set the value to 10. This is used by the JavaScript functions we'll include later, to determine how to layout the number of images that we have. So this is a p tag with an ID equal to navigation. And I'm going to put each of these on its own line, so let's indent that. Now I'll put in that hidden input tag I mentioned, so this is input with a type of hidden and an ID of panel-count, and value 10, okay, next line.

Let's put in our previous button next. This has the ID of previous, and we'll also use another attribute called the data-increment that will help the JavaScript rotate the slideshow. And here our data-increment because we're going backwards is -1, and within the button tag, let's put our label, which is previous. All right? I'll go to the end of the line and add in another button. This one has an ID of next, it also has a data-increment, and this data-increment is 1.

Let's close out our button and enter in the label, which is Next. All right, let's save our page and take a little breather before we tackle the JavaScript in the next movie.

There are currently no FAQs about CSS: Transitions and Transforms.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed CSS: Transitions and Transforms.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.