Responsive design Learn web development MDN
Quote from Deleted user on December 9, 2022, 8:38 amContent
For example, we could have one main style sheet that would define all of the main structural elements, such as #wrapper, #content, #sidebar, #nav, along with colors, backgrounds and typography. Many teams look to popular responsive-design frameworks, such as Bootstrap to help create designs. However, carefully consider how the framework will work with the content and functionality of your site, rather than how it works in what does responsive web design mean general. For example, you can also work out the order of your content differently on the mobile page than on the desktop version. By taking the mobile-first design approach, you will see both a reduction in the amount of unnecessary code written while also understanding how new CSS rules will affect the rest of your application. Responsive design is the future, with new techniques and great examples popping up every year.
Faith Njah is a front-end developer, with experience in building dynamic websites using web technologies like HTML, CSS, JavaScript, and A-frame VR. She is also passionate about learning. In addition to keeping your site visually consistent across different devices, a fluid grid controls page alignment to ensure your website looks accurate on any device. A fluid grid or fluid layout is code that uses measurements that are flexible for Hypertext Markup Language — the language used to define the layout and structure of web pages. Responsive web design takes the cake if the majority of your website traffic comes from desktops or laptops. On the other hand, if most of your web traffic is from mobile users, then you might consider a mobile-first web design.
Responsive design is the “traditional” option and remains the more popular approach to date. A responsive website shows content based on the available browser space. If you open a responsive site on the desktop and then change the size of the browser window, the content will move dynamically to arrange itself optimally for the browser window. On mobile phones, this process is automatic; the site checks for the available space and then presents itself in the ideal arrangement. In this image, you can see that the fixed version of the content has the same width regardless of the device whereas in the fluid version the content fills the available space depending on the device size.
What is Responsive Web Design?
The problem with doing the above is that the user loses the ability to zoom any text set using the vw unit, as that text is always related to the size of the viewport. In CSS Grid Layout the fr unit allows the distribution of available space across grid tracks. The next example creates a grid container with three tracks sized at 1fr. This will create three column tracks, each taking one part of the available space in the container. You can find out more about this approach to create a grid in the Learn Layout Grids topic, under Flexible grids with the fr unit.
So you should always include the viewport meta tag in the head of your documents. Media queries allow us to run a series of tests (e.g. whether the user's screen is greater than a certain width, or a certain resolution) and apply CSS selectively to style the page appropriately for the user's needs. The rest of this article will point you to the various web platform features you might want to use when creating a responsive site.
Avoid simply hiding content #
Similar to the example above, the responsive web design approach allowed Converse to provide a similar experience on any device. We’ve rounded up a list of some of the biggest brands that use a responsive web design approach for their websites. It is called responsive web design when you use CSS and HTML to resize, hide, shrink, enlarge, or move the content to make it look good on any screen. Inside the media query for a max-width of 600px, add the CSS which is only for small screens.
Modern design tools like Adobe XD, Marvel, and InVision enable teams to test prototypes on real devices, discuss feedback in context, and generally collaborate as a team until the layout works in all scenarios. Once again, a developer can achieve this with code; however, designers can improve page performance by communicating the conditions of when and where certain elements should and shouldn’t exist. People typically expect the main desktop navigation to be at the top; however, on mobile, it should be at the bottom. As we build up to the tablet version , we can then begin to think about secondary objectives and the microinteractions, user flows, and CTAs that make those user objectives achievable. What’s more important is that we focus on the primary objectives of the user first and eliminate any unnecessary friction that aids neither the primary nor the secondary objectives. Here’s a worldwide breakdown of web browser market share for mobile and desktop.
A common way to deal with this problem is to give all images a max-width of 100%. This will cause the image to shrink to fit the space it has, should the viewport size be smaller than the image. However because the max-width, rather than the width is 100%, the image will not stretch larger than its natural size. It is generally safe to add the following to your stylesheet so that you will never have a problem with images causing a scrollbar.
History of responsive web design
At the design’s smallest version, the navigation simplifies to just a drop-down menu, perfect for saving space without sacrificing critical navigation links. Because responsive design relies on shuffling elements around the page, design and development need to work closely together to ensure a usable experience across devices. Responsive design often turns into solving a puzzle — how to reorganize elements on larger pages to fit skinnier, longer pages or vice versa.
Using simple CSS adjustments can improve the website’s appearance across various devices.This last design by Bryan James shows that responsive Web design need not apply only to static HTML and CSS websites. Done in Flash, this one features a full-sized background image and is flexible up to a certain width and height. As a result of the design style, on screens that are too small, the background image gets mostly hidden and the content can become illegible and squished. Instead of just letting it be, though, a message pops up informing the user that the screen is too small to adequately view the website.
Decisions about hiding content and functionality or altering appearance for different device types should be based on knowledge about your users and their needs. The same HTML is served to all devices, using CSS to change the appearance of the page. Rather than creating a separate site and corresponding codebase for wide-screen monitors, desktops, laptops, tablets and phones of all sizes, a single codebase can support users with differently sized viewports.
Firstly, it’s usually a lot more work than creating a responsive design. For that reason, the majority of adaptive designs are used to retrofit existing sites to allow them to be used on multiple devices. It appears, then, that the first https://globalcloudteam.com/ order of business is to bring traditional sites up to date by allowing them to reach across more devices. This tends to make users happy, because that familiar web design seems guaranteed to translate across to any device’s screen.
Elevate Your E-commerce Journey With Animated UX Microinteractions
If you are comfortable with the Adobe Suite, Adobe XD is a great freewebsite mockup software that allows you to build out designs quickly. Understanding all the visual aspects of your web app on small, medium and large devices will allow you to plan howyou are going to code later on. However, if you take the “code as you go” approach, you are inevitably going to introduce unnecessary and overwritten CSS styling rules into your application and have to constantly re-work your design. Which takes considerably more time with code than with some sort of mock-up tool.
- In turn, when smartphones came onto the market, web designers had to think about how to display their pages on smaller screens.
- For example, the following media query tests to see if the current web page is being displayed as screen media and the viewport is at least 80rem wide.
- Yes, it is possible to group them into major categories, design for each of them, and make each design as flexible as necessary.
- Since responsive websites answer the requirements for the update, no changes are necessary and no shifts in performance should occur.
- Absolute measurements are great if you want something to look consistent across devices or if you want greater manual control over your elements.
- In responsive web design, we build websites to make web content adjust and adapt to different screen sizes.
This allows you to optimize breakpoints based on content and maintain the least number of breakpoints possible. For responsive web design, we are typically querying the features of the device in order to provide a different layout for smaller screens, or when we detect that our visitor is using a touchscreen. However, in the game of designing for the best user experience and providing the best solutions, we must remember that we have to take the time to examine our options and the realities of our users. Sites that use responsive design (i.e., ones with a URL that serve all devices) are currently more search engine friendly. There is a certain amount of confusion as to the difference between responsive design and adaptive design. The boundaries may seem blurred to those without experience of either style of design, but there are clear differences when you look more closely at the two.
Steps for Human-Centered Mobile Design
It is even trickier to design a website that is usable in many rearrangements or configurations of its elements, across various screen sizes and orientations. The same design element that may work swimmingly on a desktop may work horribly on a smartphone, or vice versa. In 2020, this is the most common approach to designing websites and is considered best practice. It truly is the only way you should be designing your websites and applications. Gone are the days where a static desktop site can acceptably be viewed on mobile devices. In today’s world, responsive web design is synonymous with modern web design.
Responsive Web Design vs. Mobile-First Design
The text size can be set with a "vw" unit, which means the "viewport width". The HTML element allows you to define different images for different browser window sizes. Notice that in the example above, the image can be scaled up to be larger than its original size.
If you are building a new website and want to make it responsive, it’s advisable to take the mobile-first approach. Responsive design is a somewhat retro approach to web site design that solves a lot of design problems caused by the proliferation of new types of mobile devices. Responsive design pages use X and Y coordinates on a grid for layout and mathematical percentages for images instead of fixed-width parameters. Using percentages instead of fixed-width parameters and a grid layout creates a more fluid layout that will resize itself to fit the size of the display. The practice consists of a mix of flexible grids and layouts, images and an intelligent use of CSS media queries. As the user switches from their laptop to iPad, the website should automatically switch to accommodate for resolution, image size and scripting abilities.
The smaller the screen, the more attention must of course be paid to appropriate and pleasant-to-read typography. Also make sure that the user is not overwhelmed by the content on smaller screens and consider whether some content can be hidden to make your content easier to read. What is a menu bar at the top of the screen on desktop websites is a so-called hamburger icon on smartphones and tablets.
CSS Grid
This can mean that different URLs are required between mobile and desktop web pages. Adaptive design will ensure the best user experience according to whichever device the user is using to interface. Unlike responsive design, where a screen “flows” from desktop design into a smaller device’s, adaptive design offers tailor-made solutions.
Responsive Web Design and What it Entails
Touchscreen on laptops and desktops.Touchscreens obviously come with different design guidelines than purely cursor-based interaction, and the two have different capabilities as well. Fortunately, making a design work for both doesn’t take a lot of effort. Touchscreens have no capability to display CSS hovers because there is no cursor; once the user touches the screen, they click. So, don’t rely on CSS hovers for link definition; they should be considered an additional feature only for cursor-based devices. Note in the examples below that we’re using the syntax for media queries that could be used all in one style sheet. As mentioned above, the most efficient way to use media queries is to place them all in one CSS style sheet, with the rest of the styles for the website.
Content
For example, we could have one main style sheet that would define all of the main structural elements, such as #wrapper, #content, #sidebar, #nav, along with colors, backgrounds and typography. Many teams look to popular responsive-design frameworks, such as Bootstrap to help create designs. However, carefully consider how the framework will work with the content and functionality of your site, rather than how it works in what does responsive web design mean general. For example, you can also work out the order of your content differently on the mobile page than on the desktop version. By taking the mobile-first design approach, you will see both a reduction in the amount of unnecessary code written while also understanding how new CSS rules will affect the rest of your application. Responsive design is the future, with new techniques and great examples popping up every year.
Faith Njah is a front-end developer, with experience in building dynamic websites using web technologies like HTML, CSS, JavaScript, and A-frame VR. She is also passionate about learning. In addition to keeping your site visually consistent across different devices, a fluid grid controls page alignment to ensure your website looks accurate on any device. A fluid grid or fluid layout is code that uses measurements that are flexible for Hypertext Markup Language — the language used to define the layout and structure of web pages. Responsive web design takes the cake if the majority of your website traffic comes from desktops or laptops. On the other hand, if most of your web traffic is from mobile users, then you might consider a mobile-first web design.

Responsive design is the “traditional” option and remains the more popular approach to date. A responsive website shows content based on the available browser space. If you open a responsive site on the desktop and then change the size of the browser window, the content will move dynamically to arrange itself optimally for the browser window. On mobile phones, this process is automatic; the site checks for the available space and then presents itself in the ideal arrangement. In this image, you can see that the fixed version of the content has the same width regardless of the device whereas in the fluid version the content fills the available space depending on the device size.
What is Responsive Web Design?
The problem with doing the above is that the user loses the ability to zoom any text set using the vw unit, as that text is always related to the size of the viewport. In CSS Grid Layout the fr unit allows the distribution of available space across grid tracks. The next example creates a grid container with three tracks sized at 1fr. This will create three column tracks, each taking one part of the available space in the container. You can find out more about this approach to create a grid in the Learn Layout Grids topic, under Flexible grids with the fr unit.

So you should always include the viewport meta tag in the head of your documents. Media queries allow us to run a series of tests (e.g. whether the user's screen is greater than a certain width, or a certain resolution) and apply CSS selectively to style the page appropriately for the user's needs. The rest of this article will point you to the various web platform features you might want to use when creating a responsive site.
Avoid simply hiding content #
Similar to the example above, the responsive web design approach allowed Converse to provide a similar experience on any device. We’ve rounded up a list of some of the biggest brands that use a responsive web design approach for their websites. It is called responsive web design when you use CSS and HTML to resize, hide, shrink, enlarge, or move the content to make it look good on any screen. Inside the media query for a max-width of 600px, add the CSS which is only for small screens.
Modern design tools like Adobe XD, Marvel, and InVision enable teams to test prototypes on real devices, discuss feedback in context, and generally collaborate as a team until the layout works in all scenarios. Once again, a developer can achieve this with code; however, designers can improve page performance by communicating the conditions of when and where certain elements should and shouldn’t exist. People typically expect the main desktop navigation to be at the top; however, on mobile, it should be at the bottom. As we build up to the tablet version , we can then begin to think about secondary objectives and the microinteractions, user flows, and CTAs that make those user objectives achievable. What’s more important is that we focus on the primary objectives of the user first and eliminate any unnecessary friction that aids neither the primary nor the secondary objectives. Here’s a worldwide breakdown of web browser market share for mobile and desktop.

A common way to deal with this problem is to give all images a max-width of 100%. This will cause the image to shrink to fit the space it has, should the viewport size be smaller than the image. However because the max-width, rather than the width is 100%, the image will not stretch larger than its natural size. It is generally safe to add the following to your stylesheet so that you will never have a problem with images causing a scrollbar.
History of responsive web design
At the design’s smallest version, the navigation simplifies to just a drop-down menu, perfect for saving space without sacrificing critical navigation links. Because responsive design relies on shuffling elements around the page, design and development need to work closely together to ensure a usable experience across devices. Responsive design often turns into solving a puzzle — how to reorganize elements on larger pages to fit skinnier, longer pages or vice versa.
Using simple CSS adjustments can improve the website’s appearance across various devices.This last design by Bryan James shows that responsive Web design need not apply only to static HTML and CSS websites. Done in Flash, this one features a full-sized background image and is flexible up to a certain width and height. As a result of the design style, on screens that are too small, the background image gets mostly hidden and the content can become illegible and squished. Instead of just letting it be, though, a message pops up informing the user that the screen is too small to adequately view the website.
Decisions about hiding content and functionality or altering appearance for different device types should be based on knowledge about your users and their needs. The same HTML is served to all devices, using CSS to change the appearance of the page. Rather than creating a separate site and corresponding codebase for wide-screen monitors, desktops, laptops, tablets and phones of all sizes, a single codebase can support users with differently sized viewports.

Firstly, it’s usually a lot more work than creating a responsive design. For that reason, the majority of adaptive designs are used to retrofit existing sites to allow them to be used on multiple devices. It appears, then, that the first https://globalcloudteam.com/ order of business is to bring traditional sites up to date by allowing them to reach across more devices. This tends to make users happy, because that familiar web design seems guaranteed to translate across to any device’s screen.
Elevate Your E-commerce Journey With Animated UX Microinteractions
If you are comfortable with the Adobe Suite, Adobe XD is a great freewebsite mockup software that allows you to build out designs quickly. Understanding all the visual aspects of your web app on small, medium and large devices will allow you to plan howyou are going to code later on. However, if you take the “code as you go” approach, you are inevitably going to introduce unnecessary and overwritten CSS styling rules into your application and have to constantly re-work your design. Which takes considerably more time with code than with some sort of mock-up tool.
- In turn, when smartphones came onto the market, web designers had to think about how to display their pages on smaller screens.
- For example, the following media query tests to see if the current web page is being displayed as screen media and the viewport is at least 80rem wide.
- Yes, it is possible to group them into major categories, design for each of them, and make each design as flexible as necessary.
- Since responsive websites answer the requirements for the update, no changes are necessary and no shifts in performance should occur.
- Absolute measurements are great if you want something to look consistent across devices or if you want greater manual control over your elements.
- In responsive web design, we build websites to make web content adjust and adapt to different screen sizes.
This allows you to optimize breakpoints based on content and maintain the least number of breakpoints possible. For responsive web design, we are typically querying the features of the device in order to provide a different layout for smaller screens, or when we detect that our visitor is using a touchscreen. However, in the game of designing for the best user experience and providing the best solutions, we must remember that we have to take the time to examine our options and the realities of our users. Sites that use responsive design (i.e., ones with a URL that serve all devices) are currently more search engine friendly. There is a certain amount of confusion as to the difference between responsive design and adaptive design. The boundaries may seem blurred to those without experience of either style of design, but there are clear differences when you look more closely at the two.
Steps for Human-Centered Mobile Design
It is even trickier to design a website that is usable in many rearrangements or configurations of its elements, across various screen sizes and orientations. The same design element that may work swimmingly on a desktop may work horribly on a smartphone, or vice versa. In 2020, this is the most common approach to designing websites and is considered best practice. It truly is the only way you should be designing your websites and applications. Gone are the days where a static desktop site can acceptably be viewed on mobile devices. In today’s world, responsive web design is synonymous with modern web design.
Responsive Web Design vs. Mobile-First Design
The text size can be set with a "vw" unit, which means the "viewport width". The HTML element allows you to define different images for different browser window sizes. Notice that in the example above, the image can be scaled up to be larger than its original size.
If you are building a new website and want to make it responsive, it’s advisable to take the mobile-first approach. Responsive design is a somewhat retro approach to web site design that solves a lot of design problems caused by the proliferation of new types of mobile devices. Responsive design pages use X and Y coordinates on a grid for layout and mathematical percentages for images instead of fixed-width parameters. Using percentages instead of fixed-width parameters and a grid layout creates a more fluid layout that will resize itself to fit the size of the display. The practice consists of a mix of flexible grids and layouts, images and an intelligent use of CSS media queries. As the user switches from their laptop to iPad, the website should automatically switch to accommodate for resolution, image size and scripting abilities.
The smaller the screen, the more attention must of course be paid to appropriate and pleasant-to-read typography. Also make sure that the user is not overwhelmed by the content on smaller screens and consider whether some content can be hidden to make your content easier to read. What is a menu bar at the top of the screen on desktop websites is a so-called hamburger icon on smartphones and tablets.
CSS Grid
This can mean that different URLs are required between mobile and desktop web pages. Adaptive design will ensure the best user experience according to whichever device the user is using to interface. Unlike responsive design, where a screen “flows” from desktop design into a smaller device’s, adaptive design offers tailor-made solutions.
Responsive Web Design and What it Entails
Touchscreen on laptops and desktops.Touchscreens obviously come with different design guidelines than purely cursor-based interaction, and the two have different capabilities as well. Fortunately, making a design work for both doesn’t take a lot of effort. Touchscreens have no capability to display CSS hovers because there is no cursor; once the user touches the screen, they click. So, don’t rely on CSS hovers for link definition; they should be considered an additional feature only for cursor-based devices. Note in the examples below that we’re using the syntax for media queries that could be used all in one style sheet. As mentioned above, the most efficient way to use media queries is to place them all in one CSS style sheet, with the rest of the styles for the website.