Learn Responsive Design 
Learn responsive design techniques, like relative sizing units and media queries, to create websites viewable on devices of all sizes.
StartKey Concepts
Review core concepts you need to learn to master this subject
CSS unit em
Usage of Percentages in CSS
background-size: cover;
CSS unit rem
Media Type in Media Queries
And Operator Media Queries
css media query
CSS Media Features in Media Queries
CSS unit em
CSS unit em
.nav-container {
font-size: 10px;
}
.nav-container span {
font-size: 1.5em; /* 10 x 1.5 = 15px */
}
em
is a CSS unit used to create relatively-sized content. 1 em
unit represents the base font size of the current element.
In the example code block, <span>
elements nested inside of elements with class nav-container
will have a font size of 15px
.
Sizing Elements
Lesson 1 of 2
- 1Modern technology allows users to browse the Internet via multiple devices, such as desktop monitors, mobile phones, tablets, and more. Devices of different screen sizes, however, pose a problem fo…
- 4To size non-text HTML elements relative to their parent elements on the page you can use percentages. Percentages are often used to size box-model values, like width and height, padding, border…
- 5Percentages can also be used to set the padding and margin of elements. When height and width are set using percentages, you learned that the dimensions of child elements are calculated based on t…
- 6Although relative measurements provide consistent layouts across devices of different screen sizes, elements on a website can lose their integrity when they become too small or large. You can limit…
- 7You can also limit the minimum and maximum height of an element. 1. min-height — ensures a minimum height for an element’s box. 2. max-height — ensures a maximum height for an eleme…
- 8Many websites contain a variety of different media, like images and videos. When a website contains such media, it’s important to make sure that it is scaled proportionally so that users can correc…
- 9Background images of HTML elements can also be scaled responsively using CSS properties. body { background-image: url(‘#’); background-repeat: no-repeat; background-position: center; back…
- 10Great work! You learned how to size elements on a website relative to other elements on the page. Let’s review what you learned: - Content on a website can be sized relative to other elements on…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory