At the inception of the Web, Tim Berners-Lee had little regard for relinquishing control over visual design to web developers. However, HÃ¥kon Wium Lie challenged this by proposing a technology called Cascading Style Sheet (CSS) in 1994. While immature in design, people loved the idea of separating HTML elements from additional style, and CSS rose to prominence throughout the 1990s.
The CSS3 draft was published in 1999, rolling out a number of new useful features unavailable in older browsers (notably IE). Thankfully, today's modern browsers are fully capable of handling these new features, including the following:
div
componentsHowever, there is another important contribution that transformed the Web industry.
Responsive design is an approach to create pages that accommodate a wide range of devices, and CSS3 allows developers to create a single web page that "responds" to the size of each browser and rearranges its elements accordingly. This eliminates the need to build websites exclusively designed for mobile devices, allowing a single website to "gracefully degrade" as the screen size becomes smaller.
Below is an example of media query, a CSS technique that allows responsive design:
@media screen and (min-width: 1200px) {
body { background-color: lightblue; }
}
@media screen and (min-width: 990px) and (max-width: 1190px) {
body { background-color: pink; }
}
@media screen and (min-width: 768px) and (max-width: 989px) {
body { background-color: lightgreen; }
}
@media screen and (max-width: 767px) {
body { background-color: black; }
}
With this new enhancement, web developers can assume different approaches to responsive design. These approaches vary according to project requirements, and can be classified as the following: