Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Images.docx58.9 KB Images - Solution.docx
59.4 KB
Quick reference
Images
Sometimes we need to use a different set of images for mobile design. We'll use media queries to achieve this.
When to use
Do this whenver your original images look funny on mobile devices.
Instructions
Here's how to add images to a media query...
@media only screen and (max-width: 768px) {
[class*="col-"] {
width: 100%;
}
.hike {
background-image: url(hike2.png);
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
height: 300px;
}
}
Hints & tips
- To use different images for mobile, add the new images to a media query.
Lesson notes are only available for subscribers.