Responsive Web Design
WHAT IS RESPONSIVE WEB DESIGN?
Why it's matters?
Responsive Web Design makes your web page look good on all devices (desktops, tablets, and phones). Responsive Web Design is about using CSS and HTML to resize, hide, shrink, enlarge, or move the content to make it look good on any screen.
Responsive web design is a relatively new approach to website design that ensures users have a good viewing experience no matter what type of device they’re using. It’s become increasingly important over the last few years as mobile device ownership has exploded and traditional PC sales have slowed. And now that Google is prioritizing mobile-friendly sites in its search results algorithm, it’s essential to make sure your site is optimized for mobile by using responsive design.
Initially, after the launch of the iPhone, the trend was to build separate sites depending on whether a person visited the site from a desktop computer or a mobile device. While it was easier from a development perspective, there were a significant number of drawbacks. The downsides included increasing maintenance costs, having to promote and maintain separate sites for SEO rankings and even having to build different mobile sites for different types of mobile devices.
Web designer Ethan Marcotte is credited with coining the term “responsive design.” In 2010, he published an article on A List Apart discussing the rapidly changing environment of devices, browsers, screen sizes, and orientations. Building separate sites for every type of device simply wouldn’t be sustainable. Instead, he proposed an alternative concept: responsive design, which calls for building flexible and fluid layouts that adapt to almost any screen.
Responsive web design consists of three development principles. To work properly, all three of these need to be implemented:
- Fluid grids
- Media queries
- Flexible images and media
- Fluid Grids
Flexible grid-based layout is the cornerstone of responsive design. It uses relative sizing to fit the content to the device’s screen size. The term “grid” is a little misleading because it’s not necessary to implement any of the available grid frameworks. Instead, CSS is used to position the content. This approach is based on percentages and is a departure from traditional pixel-based design principles. Responsive design moves away from the pixel-based approach because a pixel on one device could be eight pixels on another device. By basing text size, widths, and margins on percentages, a fixed size can be turned into a size relative to its display space.
Media queries, also known as breakpoints, can be used to apply different styles based on the capabilities of the device. The website detects the type of device you’re using or the size of your web browser and correctly displays the page. To see this in action, stretch the window of your web browser to different sizes. Notice how the page adjusts. Features can be used to control the width, height, max-width, max-height, device-height, orientation, aspect ratio, etc.
Flexible Images and Media
This feature allows you to adapt images and other media to load differently, depending on the device, either by scaling or using the CSS overflow property. Scaling in CSS is relatively straightforward—the media element’s max width can be set at 100 percent, and the web browser will make the image shrink and expand depending on its container. An alternative to scaling media is to crop it with CSS. Applying overflow:hidden allows images to be cropped dynamically so that they fit into their containers.