Responsive Design Mode Chrome and its Developer Toolbox

Author

Reads 1.3K

Black Background With Text Overlay Screengrab
Credit: pexels.com, Black Background With Text Overlay Screengrab

Responsive Design Mode Chrome is a powerful tool for web developers, allowing them to test and refine their website's responsiveness on different devices and screen sizes.

To access Responsive Design Mode Chrome, you can enable it by clicking on the three dots in the top right corner of the Chrome browser and selecting "More tools" > "Developer tools" > "Toggle device toolbar".

This feature is especially useful for developers who want to ensure their website looks great on various devices, from desktop computers to mobile phones and tablets.

The Responsive Design Mode Chrome also includes a Developer Toolbox, which offers a range of tools and features to help developers debug and optimize their website's performance.

If this caught your attention, see: Safari Browser Developer Tools

Toggling and Controlling RDM

Toggling Responsive Design Mode is a breeze with Firefox. You can do it from the Firefox menu, Developer Tools toolbox, or even from the keyboard by pressing Ctrl + Shift + M (or Cmd + Opt + M on macOS).

Curious to learn more? Check out: Inspect Element Mozilla

Credit: youtube.com, Simulate mobile devices with Device Mode #DevToolsTips

To toggle Responsive Design Mode, you can also use the keyboard shortcut Ctrl + Shift + M (or Cmd + Opt + M on macOS). This is a quick and easy way to switch between responsive design mode and regular browsing.

There are three ways to toggle Responsive Design Mode: from the Firefox menu, Developer Tools toolbox, or from the keyboard.

A different take: Tailwindcss Dark Mode

Controlling

You can control Responsive Design Mode (RDM) in several ways. To toggle RDM, you can press Ctrl + Shift + M (or Cmd + Opt + M on macOS) from the keyboard.

The device you select when in RDM and the orientation (portrait or landscape) is saved between sessions. Information for the selected device is centered over the display.

The display includes the name of the selected device, screen size, orientation, DPR (pixel ratio), and throttling. You can edit the width and height values to change the device size by editing a number directly or using the Up and Down keys to increase or decrease the value by 1 pixel on each keypress.

HTML and CSS code on a computer monitor, highlighting web development and programming.
Credit: pexels.com, HTML and CSS code on a computer monitor, highlighting web development and programming.

The DPR is no longer editable; create a custom device in order to change the DPR. You can select the connection throttling to apply, for example 2G, 3G, or LTE.

To control the reloads, you can check the final two options in the Settings menu. Reloading on these changes can be helpful because certain page behaviors would otherwise not be applied.

Here is a list of the settings you can control:

  • Left-align Viewport - moves the RDM viewport to the left side of the browser window
  • Show user agent - displays the user agent string
  • Reload on device change - reloads the page when you change the device
  • Reload on orientation change - reloads the page when you change the orientation

Now when you change such settings for the first time, you are given a warning message that tells you these reloads are no longer automatic, and informed about how you can make them automatic.

Rotate to Landscape

Rotating the viewport to landscape orientation is a straightforward process. Click the screen_rotationRotate button to achieve this.

The Rotate button is easily accessible, but be aware that it disappears if your Device toolbar is narrow.

Understanding RDM

Responsive Design Mode, or RDM, is a feature in Chrome DevTools that allows you to simulate mobile devices and test your website's responsiveness.

Credit: youtube.com, Chrome DevTools Responsive Mode

You can show or hide the Developer Tools toolbox independently of toggling Responsive Design Mode itself, making it easy to work with. The toolbox includes various tools like Page Inspector, Web Console, and JavaScript Debugger.

RDM is enabled while you continue browsing as you normally would in the resized content area, allowing you to test your website's responsiveness without interrupting your workflow.

Overview

Understanding RDM is a powerful tool for web developers, and one of its key features is Responsive Design Mode (RDM). RDM allows you to simulate different screen sizes and devices, making it easier to test and optimize your website's responsiveness.

You can show or hide the Developer Tools toolbox independently of toggling RDM itself, which is a convenient feature for developers who need to access various tools while still being able to browse the resized content area.

One of the benefits of using RDM is that you can continue browsing as you normally would in the resized content area, even when RDM is enabled. This allows you to test your website's responsiveness in real-time, without having to switch between different views.

Consider reading: One Page Responsive Design

Credit: youtube.com, A Sneak Peak into RDM

Here are some of the tools you can access while RDM is enabled:

  1. Page Inspector
  2. Web Console
  3. JavaScript Debugger
  4. Network Monitor
  5. Performance
  6. Application
  7. Responsive Design Mode
  8. Accessibility Inspector
  9. More Tools
  10. Connecting the devtools
  11. Debugging the browser
  12. Settings
  13. Tips

Device mode is another feature of RDM that allows you to simulate mobile devices. This feature includes tools such as simulating a mobile viewport and throttling the CPU and network.

Additional reading: Mobile First Website Design

Limitations

Device mode is a useful tool for simulating the mobile user experience, but it's essential to understand its limitations. You don't actually run your code on a mobile device when using device mode, you only simulate the experience from your laptop or desktop.

Device mode can't replicate the unique architecture of mobile CPUs, which are different from those found in laptops or desktops. This means that some aspects of mobile devices will never be accurately simulated.

If you're unsure about how your page will behave on a mobile device, your best bet is to run it on the actual device.

Readers also liked: Mobile Responsiveness

Viewports

Viewports are an essential aspect of mobile device simulation, and understanding how they work can greatly impact your development process.

Web Text
Credit: pexels.com, Web Text

By default, smartphone browsers pretend to be high-resolution desktop browsers, laying out pages as if viewed on a desktop monitor. This is why you get a tiny-text "overview mode" that's impossible to read before zooming in.

The default viewport width for the default Android browser is 800px, and 980px for iOS, regardless of the actual physical pixels on the screen. This is why setting the width to device-width in the viewport meta tag is useful, as it updates when the user changes the orientation of their smartphone or tablet.

Most modern smartphone browsers currently report a standard device-width in the region of 320px. If your mobile device actually has a width of 640 physical pixels, then a 320px wide image would be sized to the full width of the screen, using double the number of pixels in the process.

Here are some common mobile screen resolutions:

To simulate a mobile viewport, you can use the Dimensions drop-down in the device toolbar, which allows you to simulate the dimensions of a specific mobile device.

Setting the device type can also impact how your page is rendered. For example, selecting the "Mobile" option will render the page as a mobile viewport, while selecting "Desktop" will render it as a desktop viewport.

You might enjoy: Responsive for Mobile Css

Using RDM

Credit: youtube.com, Test Web Page Responsiveness in Chrome using Responsive Viewer

You can show or hide the Developer Tools toolbox independently of toggling Responsive Design Mode itself.

To access the Developer Tools toolbox while in RDM, you can press CTRL + SHIFT + M or tap the little icon to the left of Elements in the top-left corner of your developer tools. It’s the one that looks like a small rectangle overlapping the corner of a larger rectangle.

The Developer Tools toolbox has a variety of tools, including Page Inspector, Web Console, JavaScript Debugger, Network Monitor, Performance, Application, Responsive Design Mode, Accessibility Inspector, More Tools, Connecting the devtools, Debugging the browser, and Settings.

To test how your site will perform based on different Internet connection speeds, you can toggle the Internet speed in the top-right of your Page Inspector tools. Alternatively, you can open it using the same CTRL + SHIFT + M command as Chrome.

Using Google Chrome

You can open responsive design mode in Google Chrome by pressing CTRL + SHIFT + M or by tapping the little icon to the left of Elements in the top-left corner of your developer tools.

Credit: youtube.com, How to use Google Chrome Remote Desktop

This will show you what your site will look like on a smartphone screen measuring 400 x 562 pixels.

To see how it looks on other screen sizes, tap the downward-pointing arrow next to the words Dimensions: Responsive.

You can select any number of popular smart devices to test how your site will look on them.

Chrome will also show you how your site will perform based on different Internet connection speeds.

You can toggle the Internet speed to test performance and see how your site looks with different Digital Pixel Ratio (DPR) settings.

Show Media Queries

To show media query breakpoints above your viewport, click More options > Show media queries. This will display two additional bars above the viewport: a blue bar with max-width breakpoints and an orange bar with min-width breakpoints.

You can click between breakpoints to change the viewport's width so that the breakpoint gets triggered. To find the corresponding @media declaration, right-click between breakpoints and select Reveal in source code. DevTools will open the Sources panel at the corresponding line in the Editor.

Here are the two types of breakpoints you'll see:

  • The blue bar with max-width breakpoints.
  • The orange bar with min-width breakpoints.

By using these breakpoints, you can see how your website will adapt to different screen sizes and devices.

Set the Type

Crop unrecognizable developer using laptop and smartphone
Credit: pexels.com, Crop unrecognizable developer using laptop and smartphone

Setting the type of device in RDM is a straightforward process. You can find the list of device types on the action bar at the top, but if it's not visible, you can select More options > Add device type.

The next step is to choose the right device type for your needs. Rendering method, cursor icon, and events fired are the key differences between the options.

Here's a quick rundown of the differences between the options:

If none of the standard device types meet your needs, you can always add a custom mobile device. This involves clicking the Device list, selecting Edit, and then adding a custom device with a name, width, and height.

You might like: Custom Css Stylesheet

Add Custom Mobile

You can add a custom mobile device in Responsive Design Mode by clicking the Add Custom Device button. This allows you to create a device with its own unique settings.

To do this, click the Device list and then select Edit. You'll be taken to the Devices tab, where you can choose from a list of supported devices or click Add custom device to create your own.

Credit: youtube.com, How To Create Custom Mobile Device Mockups

If you're creating your own device, enter a name, width, and height for the device, and then click Add. The device pixel ratio, user agent string, and device type fields are optional, but can be useful for specific use cases.

Here's a summary of the steps to add a custom mobile device:

  1. Click the Device list and then select Edit.
  2. On the Settings > Devices tab, either choose a device from the list of supported ones or click Add custom device to add your own.
  3. If you're adding your own, enter a name, width, and height for the device, then click Add.
  4. Back in the viewport, select the newly added device from the Dimensions list.

By following these steps, you can create a custom mobile device that meets your specific needs.

Frequently Asked Questions

How to do responsive testing in Chrome?

To perform responsive testing in Chrome, open the website you want to test and access the Developer tools by clicking More tools > Developer tools. From there, toggle the device to select an Android or iOS device for testing

Judith Lang

Senior Assigning Editor

Judith Lang is a seasoned Assigning Editor with a passion for curating engaging content for readers. With a keen eye for detail, she has successfully managed a wide range of article categories, from technology and software to education and career development. Judith's expertise lies in assigning and editing articles that cater to the needs of modern professionals, providing them with valuable insights and knowledge to stay ahead in their fields.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.