In the last few years, CSS has enjoyed a raft of new features. Some enable us to animate and transform elements, others allow us to create background images, gradients, mask and filter effects, and others still allow us to bring SVG elements to life.
We will get to all those capabilities in the next few chapters. Firstly I think it will be useful to look at some of the fundamentals that have changed in CSS in the last few years: how we select elements on the page, the units we can use to style and size our elements, and how existing (and future) pseudo-classes and pseudo-elements make CSS ever more powerful. We will also look at how we can create forks in our CSS code to facilitate the features supported in different browsers.
In this chapter, we will learn the following:
:empty, ::before, ::after, :target, :scope):has)calc function is and how to use itvh, vw, vmin, and vmax)@font-faceNo one can know everything. I've been working with CSS for over a decade and on a weekly basis I still discover something new in CSS (or rediscover something I'd forgotten). As such, I don't feel that trying to know every possible CSS property and value permutation is actually a worthy pursuit. Instead, I think it's more sensible to develop a good grasp of what's possible.
As such, we are going to concentrate in this chapter on some of the techniques, units, and selectors I have found most useful when building responsive web designs. I'm hoping you'll then have the requisite knowledge to solve most problems that come your way when developing a responsive web design.