How to Edit CSS Using Google Chrome Developer Tools

The Google Chrome browser includes Developer Tools to assist with troubleshooting and developing your website. For instance, by using its device toolbar you can easily preview websites as they would display on various mobile devices. There are also tools that allow you to Inspect Elements on a page and edit the CSS live, without affecting the experience for other visitors interacting with your website. This can be useful in developing and previewing CSS modifications to your existing website prior to making those changes live. In this guide, you will learn how to use Google Chrome’s Developer Tools to inspect an element, modify CSS, and preview CSS changes in your browser.

Access Chrome Developer Tools

  1. Open the Google Chrome browser application on your computer.

  2. Visit your website and navigate to a page that you want to make changes on.

  3. To open Google Developer Tools you can follow any of the steps below:

  4. Press the F12 key.
    Select the Menu icon, hover over More Tools, and click on Developer tools.
    Press Ctrl + Shift + i for Windows/Linux (or command + option + i for Mac).
    Right-click on an element on your website page and select Inspect.

Now that you are familiar with accessing Google Chrome Developer Tools, you will be able to inspect CSS elements to modify them live.

Inspect an Element

Inspecting an element helps to identify the code needed to modify a particular object on your website. Google Developer Tools simplifies this process by displaying and highlighting the specific code that renders the element being inspected. Follow either of the steps below to learn how to inspect an element.

  1. Open Google Developer Tools and click the Select Element icon from the top left.

  2. Click on any object (text, heading, image, etc) that you would like to customize.

Inspecting an element is the first step to implementing the code needed to modify the object you want. However, DevTools also allows you to modify CSS live.

Making Live Changes to CSS

Google Chrome provides the ability to make changes to the CSS live from within the DevTools Console. This ensures that you are able to preview the changes yourself without affecting the appearance of your website for other visitors. There is no need to refresh your browser to see the changes, they are updated in real-time. In fact, if you refresh your browser after making changes in the Developer Tools console, your changes will be lost because the browser will reload the unmodified version of your website. Using Chrome for live CSS testing ensures that your live website’s actual code remains untouched.

  1. Navigate to a page of your website that you would like to modify the CSS for and inspect an element on the page.

  2. Click on the Computed tab.

  3. Hover over an attribute and click on the arrow icon that appears next to its value.

  4. To change an attribute, you can simply click on the value and type in the new value you want.

Now that you are familiar with this neat tool found in your Google Chrome browser, you can unleash your CSS editing skills.

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Join the conversation!