How to enable real time CSS editing in chrome?

12,714

Solution 1

You are doing it wrong... the resources panel is not there for live edit, if you want to change the css associated with an HTML element, right click on that element and then in the right panel you will see the css styles associated with the selected element. You can edit that rules and you will see the changes in real time.

Maybe you can check some videos to learn some basics about the Chrome Developer Tools, and after that if you want to learn more, you can check this question:

Chrome Developer Tools: Best resource for learning advanced features?

Solution 2

Here is a great tool for Google Chrome called Stylebot.

In this you can change the style sheet and save your own styles to any website for your own custom website theme!

Here is the link for Stylebot

Check it out and to put the icing on the cake, it's free!

This should not be used to work on your own website projects since the CSS file saves local on your browser!

Solution 3

In Chrome, clicking on something like "all.css:1" in the Styles pane of the Elements tab of DevTools takes one to the Sources tab of DevTools. If you're looking at code on remote server, the CSS rules in this source view are not live-editable (unlike the live-editing Style Editor tab of Firefox*) unless you're:

  1. viewing the "inspector-stylesheet" -- a temporary stylesheet containing new style rules you created with the "+" button in the Styles pane of the Elements tab. Clicking on a new rule's "inpector-stylesheet:1" link will take you to the editable source of the temporary rules you've created.

  2. viewing a persistent local workspace. Setting this up takes a few extra steps, described here: "Set Up Persistence with DevTools Workspaces" . Basically, you make a local folder on your machine where you can save local copies that you direct Chrome to use in in lieu of the version on the internet. See the instructions at that link. Note that, as it says there, "If you are mapping files from a remote server instead of a local server, when you refresh the page, Chrome reloads the page from the remote server. Your changes still persist to disk and are reapplied if you continue editing in Workspaces." (So just type a space character into the source local CSS file to see your alterations applied again, if you've refreshed or navigated to a different page that uses the same stylesheet.)


* In Firefox, if you right-click on an element on a remote webpage, select Inspect Element, then in the Rules pane of the Inspector tab, click on a link on the right like "all.css:1", you are taken to a "Style Editor" tab where you can immediately live-edit, in contrast to Chrome's requirement of making you map to a local file. This may cause some people some confusion, if they expect the same behavior from Chrome's DevTools.

Share:
12,714
narayanpatra
Author by

narayanpatra

Updated on June 04, 2022

Comments

  • narayanpatra
    narayanpatra almost 2 years

    I have seem a lot of videos in which developers are changing CSS on the fly in chrome. I tried the same thing but chrome did not allow me to change the code. I can't write on the style sheet.

    Is there any specific setting to do this? Kindly help.

    EDIT: To edit the CSS, I right click on an element, select inspect element. It will open the console. I select the id of the element and go to style.css in Resources and try to change the CSS. It does not allow me to write there.

  • Josh Powell
    Josh Powell over 10 years
    No problem! Best of luck in your project!
  • G-Man Says 'Reinstate Monica'
    G-Man Says 'Reinstate Monica' over 2 years
    Hello.  I thought you might want to know that you are misspelling Monica’s last name in your profile (the second time you mention it, in the last sentence).
  • Jacob C.
    Jacob C. over 2 years
    @G-ManSays'ReinstateMonica' Corrected -- good catch.