Google Chrome Dev Tools inspect element styles not showing

前端 未结 12 932
难免孤独
难免孤独 2020-12-13 23:44

Starting a couple of weeks ago....on some of our sites, but not all, when inspecting an element, the styles tab only shows the \"styles box\", but not the actual styles rela

相关标签:
12条回答
  • 2020-12-13 23:58

    I just close the tab, and reopen it, and then right click > inspect element. Don't need to restore the whole dev tools to default settings. It's a waste. Try it, it works! :)

    0 讨论(0)
  • 2020-12-13 23:58

    I was also facing this problem, in addition to the suggestions the other users made it worked for me accessing:

    Chrome Developer Tools -> CSS -> Relaoad Linked Style Sheets

    Image Ilustrating the procedure

    0 讨论(0)
  • 2020-12-13 23:58

    Another one for the mix - using CSS variables but one of the variables was referencing another variable that didn't exist.

    Elements using that missing variable in the chain just don't show up in chromium at all (it hid all references to h2s in the case of my site).

    Interestingly, it still shows the elements in Firefox's dev tool panel.

    0 讨论(0)
  • 2020-12-14 00:00

    Look for errors in the CSS file, in my in my case it was on the global CSS variables, fixing the errors solved the problem.

    This tool can help you find the errors: https://jigsaw.w3.org/css-validator/

    0 讨论(0)
  • 2020-12-14 00:01

    I just had this same issue and to resolve it I went into Chrome Developer Tools -> Settings -> Scroll to the bottom and click "Restore defaults and reload" then it all magically came back!

    I hadn't changed anything between it working and when it stopped so not sure why it broke but hopefully this helps you too.

    0 讨论(0)
  • 2020-12-14 00:03

    I think your CSS files are not loaded properly. Just check the syntax for referencing the external stylesheets.

    It should be like this

    <link rel="stylesheet" type="text/css" href="mystyle.css">
    

    If you are skipping the rel="stylesheet", browser may think it as a plain file. To confirm the loading of stylesheets go for Chrome Inspector -> Sources

    Check the site resources

    No need of resetting anything. Hope it helps :)

    0 讨论(0)
提交回复
热议问题