Responsive Web Design: The Art of Media Queries

Introduction

With the increasing number of mobile devices, operating systems and their versions, screen sizes and their resolutions, the need for mobile browsers to access websites is also growing. So the challenge is to ensure that a single source code version of the server-side UI layouts can render the web page correctly on different screen sizes. Therefore, mobile-enabled web applications on tablets, smartphones, phablets, etc. it’s not just a matter of viewing the same web page (which was originally designed for a desktop/laptop) in a mobile browser, as it will result in horizontal and/or vertical scrollbars, making the page look unusable. Mobile-enabling a web app requires a completely different approach to make it usable across the variety of device form factors. The solution is to make the app compatible with all devices running a web browser.

Responsive Web Design (RWD), which simply means designing your app by running some “media queries” that will identify the device’s screen size and resolution, is a key enabler! However, RWD is not as simple as it seems. It all happens in the background to make sites so responsive that the consumer doesn’t have to switch between apps or URLs.

Let’s see what RWD has to offer!

What is Responsive Web Design (RWD)?

In RWD, all visual elements on a web page become proportional to the full size of the page through the use of fluid ratio-based grids, flexible images, and CSS3 media queries. Fluid layouts could be first aid, while media queries are useful for adding flavor to mobile devices. The RWD concept is best used for minimizing efforts and money, multi-browser compatibility, optimal performance, and heavy content. And to achieve this, the design has to be driven by the system, compared to the pages.

Some rules to follow include: verify content, use a small mobile device to form the design foundation, apply features for a browser, use a modular approach, and design a framework that is scalable across business verticals. Managing corporate branded UI themes as part of this framework provides much more flexibility in serving this as a solution to clients.

Examples of ready frameworks, with the possibility of including some customization include Bootstrap, Skeleton, The Goldilocks approach, Foundation, etc…

The key is to understand and follow the guidelines below:

  • Our pages must be displayed readable on any screen resolution
  • We mark a set of content, making it visible on any device
  • We should never show a horizontal scrollbar, whatever the size of the window

To achieve the above, it is necessary to use the following principles that are based on CSS:

  • Flexible layouts – use proportional sizes to fit each page
  • Flexible images and media: Use CSS to prevent images or media from spilling out of the elements that contain them.
  • Media Queries – Use the CSS3 Media Queries module to detect media features like screen resolution and respond accordingly

The magic of media inquiries!

Media queries enable the creation of an optimal viewing experience on devices by doing the following:

  • Media queries allow the web page to use different CSS style rules based on device characteristics, especially once you identify the width of the browser.
  • Media queries adapt CSS to any device by identifying your media using a specific query, such as its width, height, and resolution.
  • A media query consists of a type, such as screen and print, and a zero along with more expressions to compare against the media. Once the expressions evaluate to true, the CSS rule is applied.

The challenge continues where different devices may have similar screen resolution but completely different physical factors (eg iPad and Kindle). “Media Query Resolution”, a media query specification that would normally guarantee to bridge this small gap between physical and digital pixels.

“Media queries are now very well supported in modern browsers (including IE9+) and mobile browsers as well, which can really make the difference between a website that degrades well in a mobile browser and one that is enhanced for take advantage of rich optimized UI”… (Reference: Google web master team)

Adoption

RWD is becoming a de facto web standard by designing the user interface for web and mobile browsers. Some examples analyzed through the reports and analysts view:

  • The US government officially endorses RWD as best at providing greater accessibility to government information and resources
  • Microsoft has a clean and less cluttered corporate website that uses multiple CSS files to resize all design elements on different device sizes.
  • Currys has engaged in smart design where some of its design elements change multiple times for multiple screen sizes and it is smart enough to bring a rich experience to its users.
  • Starbucks has implemented a unique style of media queries where navigation elements are replaced with a single symbol that leads to all menu items instead of converting them to symbols.

The above are a few key examples that prove there is a lot of buzz going on in RWD. Clearly, the world has moved to become more mobile, with people increasingly interacting with their cell phones rather than using regular browsers when consuming content from the Internet.

The content will be more structured, the pages will be more modularized and the user experience will be more attractive. It is not something that is forgotten in the midst of discussions of style guides and revisions of drafts. Today, customers go beyond “Look and Feel” and demand a “Customer Experience”. Previously, the design of a web page was judged on how good it looked to the stakeholders, whereas now everyone in a web design project is forced to think about how the end user consumes the content and what is really important in it. different devices, and for the site. usually.

Why is RWD the best option for an Organization’s mobility strategy?

When considering an RWD for an app or website that isn’t currently mobile-friendly, always think about the future, not just the present.

  • The best advantage or benefit of using RWD techniques is that it doesn’t target just devices, but adjusts to fit any screen size, which is very future friendly.
  • This is a recommended mobile setting as it has a URL with the same HTML on all devices and desktops. Such content is much easier to manage from a single source and share among multiple users rather than having separate sites. For example, an app applicable to both a mobile device and a desktop when accessed from two different URLs may result in a less than optimal user experience when viewing the same desktop results in a simplified version on a mobile device.
  • While the layout can be adjusted in terms of column width to fit the size of a screen, be it desktop or mobile, overall the layout and style of the (fluid) layout remain consistent throughout.
  • Since all the content is in a single URL, it is helpful with factors like social sharing, search engine rankings, bookmarking, web stats, etc. all in a single version to maintain, thus saving time and effort

conclusion

Responsive web design is in its early stages and therefore there will be multiple opinions and recommendations to try and resolve usability issues that arise due to variations in device size. Whether to build mobile-first or desktop-first designs or to dive deep into RWD to meet such challenges is a decision that will continue as a debate for some time as RWD standards continue to evolve as better ways to handle the changing world of devices and browsers. .

Creating a user interface using RWD is a complex subject, but over time it will become a necessity for web designers to make websites easily available to the growing consumer base.

Leave a Reply

Your email address will not be published. Required fields are marked *