Take a look at the MDN page for background-image
, and use this picture of a Husky: http://whatisjasongoldstein.github.io/buildcss/img/husky.jpg
.
The image is square, but the boxes we're using it as a background on are not. (You can tell this where the orange background-color
shows through.)
Going left to right, do this:
cover
the box (hint: background-size: cover
) and be positioned so the tops align.background-size:contain
).background-repeat
.background-position
).background-repeat
), positioned 10px from the top. Make sure never to cut the image, it shouldn't be cut off at the box.background-size
to a percentage to make that happen.background-size
and background-position
to zoom in.Special Thanks: The giant fluffy creature shown above is Koda. Because we live in a ridiculous world, you can see more pictures of her on Instagram.