Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Adding responsive images and videos


From:

WordPress: Building Responsive Themes

with Morten Rand-Hendriksen

Video: Adding responsive images and videos

It's relatively easy to create responsive text elements on a web page. Text, after all, is designed to reorganize and flow depending on the size of the box that contains it. Images and video are different matter entirely. Images by their very nature have a fixed height and width, and we have to deal with that in a nondestructive and functional manner. And when it comes to videos, it's a total gong show because there's so many standards out there and more often than not, we are pulling the videos from external sources like YouTube and Vimeo, and those sources put restrictions on us.
Expand all | Collapse all
  1. 4m 5s
    1. Welcome
      1m 4s
    2. Using the exercise files
      1m 27s
    3. What you should know before watching this course
      1m 34s
  2. 8m 36s
    1. What is responsive design?
      4m 16s
    2. The different faces of WordPress on mobile
      1m 55s
    3. Exploring the finished Anaximander theme
      2m 25s
  3. 9m 38s
    1. Getting and installing the Anaximander theme
      1m 53s
    2. Configuring basic theme options
      7m 45s
  4. 23m 51s
    1. Deciding what screen sizes to design for
      4m 11s
    2. Thinking responsively: Designing for many different screen sizes
      6m 23s
    3. Visualizing content realignment for better markup
      4m 35s
    4. Designing menus
      4m 52s
    5. Adding responsive images and videos
      3m 50s
  5. 26m 8s
    1. What are media queries and how do they work?
      4m 18s
    2. Exploring CSS3, progressive enhancement, and graceful degradation
      3m 27s
    3. Understanding best practices for media queries
      3m 57s
    4. Creating a responsive frame
      5m 12s
    5. Customizing media queries with the Chrome Developer Tools
      5m 28s
    6. Taking device width into account
      3m 46s
  6. 11m 1s
    1. Resizing the site title and the description
      8m 22s
    2. Adding media queries to the header
      2m 39s
  7. 11m 22s
    1. Making the menu responsive
      3m 35s
    2. Creating a different menu design for small screens
      7m 47s
  8. 19m 22s
    1. Making a responsive single-post layout
      6m 11s
    2. Making images responsive
      4m 37s
    3. Making videos responsive by including FitVids
      8m 34s
  9. 7m 45s
    1. Making the sidebar responsive
      5m 10s
    2. Hiding sidebars on mobile
      2m 35s
  10. 7m 28s
    1. Dealing with footer widgets
      5m 11s
    2. Adding navigation links that return to the top of the page
      2m 17s
  11. 12m 54s
    1. Using FlexSlider to create a responsive slider
      6m 2s
    2. Creating a loop to show sticky posts in a featured slider
      6m 52s
  12. 24m 37s
    1. What is jQuery Masonry?
      3m 41s
    2. Installing jQuery Masonry
      4m 45s
    3. Configuring the index page with Masonry
      7m 0s
    4. Using CSS to finalize the Masonry layout
      6m 17s
    5. Adding media queries to the Masonry index
      2m 54s
  13. 9m 11s
    1. Exploring hidden features of the Anaximander theme
      5m 51s
    2. Where to go from here
      3m 20s

please wait ...
Watch the Online Video Course WordPress: Building Responsive Themes
2h 55m Intermediate Aug 17, 2012

Viewers: in countries Watching now:

The many ways visitors access web sites, via mobile devices, tablets, and desktops, now requires sites to incorporate responsive design elements that adapt to different screen sizes and browsers. In this course, Morten Rand-Hendriksen demonstrates design strategies, best practices, and actual code examples for creating a responsive web site. The course covers layout, navigation, responsive video embedding, and content sliders. The final chapter shows how to create an index page with jQuery Masonry, a jQuery plugin that helps you create dynamic grid layouts.

Topics include:
  • What is responsive design?
  • Installing the Anaximander example theme
  • Deciding what screen sizes to target
  • Designing menus
  • Adding responsive images and video
  • Using CSS media queries to apply different styles
  • Handling sidebars on mobile displays
  • Dealing with footer widgets
  • Installing jQuery Masonry
Subject:
Web
Software:
WordPress
Author:
Morten Rand-Hendriksen

Adding responsive images and videos

It's relatively easy to create responsive text elements on a web page. Text, after all, is designed to reorganize and flow depending on the size of the box that contains it. Images and video are different matter entirely. Images by their very nature have a fixed height and width, and we have to deal with that in a nondestructive and functional manner. And when it comes to videos, it's a total gong show because there's so many standards out there and more often than not, we are pulling the videos from external sources like YouTube and Vimeo, and those sources put restrictions on us.

But fret not, my friend. All can be solved with code. We just have to decide what the end result should look like first. Let's take a look at the images on this page. Before we dive into the code itself, I just want to give you an idea of what we're talking about when we are talking about responsive images and responsive video. If you look at this page, we have fixed widths for these images. If I change the size of my window, you will see that the image stays the same size no matter what I do.

However, if I open this post in a single post and then again resize the window, you will see that the image will resize with the window. In certain sizes, you'll even see this image resize dynamically, like this. This is a built-in function in your browser where the browser automatically will realign the image and crunch the pixels to make everything work, but it's a function that you have to activate through the use of CSS.

If you don't do it, you will end up with an image that stays the same size and as you resize your window, the image gets cropped closer and closer and closer and closer. I am sure you have seen this, both on your cell phone and also on web sites time and again, because it's fairly common. But in this course, we are going to look at how to work around it. There is one more important thing you need to remember. When you upload an image to WordPress, what WordPress does is it creates multiple different versions of that image in different sizes.

As a result, the image we are looking at here is 620 x 375 pixels; however, if we go and look at the image on the front page, you see it's 298 x 180 pixels. This is important, because when you're loading the front page and you know that the image is going to be a fixed width and it's going to be small, you don't want to load up a huge image and then crunch it down to fit that small space. You want to load the image that's exactly the size you are for and in an ideal world, there would be a standard for this so that it would be easy to do and you could serve properly responsive images.

Unfortunately, we're not at that point yet, because the browser manufacturers are still arguing over what is the best approach. So in the meantime, we have to handle those images ourselves and decide whether we want to take a large image and scale it down or if we just want to use small images. Like I said in the intro, compared to videos, images are easy. Videos are a whole different ball of wax, and in this course, you will learn how to make properly responsive videos, because when a video comes from YouTube or Vimeo or anywhere else, it's not responsive, which means if you resize the window, the video will stay the same size.

It's a very frustrating problem, and it's not a problem that you can just fix with CSS. To fix that, we have to link to a JavaScript library designed specifically to address responsive videos, and we'll also do that in this course. Both images and videos can be made to be responsive, but it requires some decision making and some creative coding on our end. Fortunately for you, all of this can be solved with code, and all of it's covered in this course.

There are currently no FAQs about WordPress: Building Responsive Themes.

 
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.

* Estimated file size

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 WordPress: Building Responsive Themes.

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


OK

Upgrade to View Courses Offline

login

With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

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 ?

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:

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.

Start your FREE 10-day trial

Begin learning software, business, and creative skills—anytime,
anywhere—with video instruction from recognized industry experts.
lynda.com provides
Unlimited access to over 4,000 courses—more than 100,000 video tutorials
Expert-led instruction
On-the-go learning. Watch from your computer, tablet, or mobile device. Switch back and forth as you choose.
Start Your FREE Trial Now
 

A trusted source for knowledge.

 

We provide training to more than 4 million people, and our members tell us that lynda.com helps them stay ahead of software updates, pick up brand-new skills, switch careers, land promotions, and explore new hobbies. What can we help you do?

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.