Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Setting up the HTML

From: CSS: Transitions and Transforms

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.

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.

Show transcript

This video is part of

Image for CSS: Transitions and Transforms
CSS: Transitions and Transforms

26 video lessons · 14859 viewers

Joseph Lowery
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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.


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 Already a member? Log in

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.