Learn Responsive Design - Learn Responsive Design Cheatsheet - Codecademy
Learn Responsive Design - Learn Responsive Design Cheatsheet - Codecademy
CSS unit em
em is a CSS unit used to create relatively-sized .nav-container {
content. 1 em unit represents the base font size of the
font-size: 10px;
current element.
}
In the example code block, <span> elements
nested inside of elements with class nav-
container will have a font size of 15px . .nav-container span {
font-size: 1.5em; /* 10 x 1.5 = 15px */
}
.news-row .news-column {
height: 80%; /* 240px */
width: 50%; /* 250px */
}
background-size: cover;
The CSS background-size property is used to
specify the size of the background image. When given
the value cover , like background-
size:cover , the image covers the complete
background of the container in which it is being
displayed.
The proportions of the image are maintained, so if the
dimensions exceed the container’s, then some parts of
the image will be left out.
#photo {
width: 100%;
}
}