I found lots of questions regarding the grayed out styles in Chrome developer tools, but none that describes the strange behavior I have. I have plain class styles in a CSS file. For some reason I can edit one of them, but not the other:
CSS file:
.result {
background-color: #000;
width: 100%;
height: 100%;
position: absolute;
z-index: 100;
}
.result_image {
height: 80%;
overflow: hidden;
}
.result_text {
font-size: 13.6px;
margin-left: 5px;
font-weight: bold;
height: 20%;
}
HTML:
<div class="result">
<div class="result_image"><img src="..."></div>
<div class="result_text">Some text</div>
</div>
As you can see in the screenshots, I can edit the div class="result_image", but not the div class="result_text". I think the problem has something to do with Chrome claiming that the grayed out style comes from a style-tag, but both styles are in the file "qb1.core.css".
@Rob To be precise, when a style is shown greyed out, it means it has been inherited from some other encompassing element but is not applicable to the selected element. From the documentation: "The pane contains only properties from rules that are directly applicable to the selected element.
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.
You may see that CSS is not working on Google Chrome, but it works on IE, Firefox, Edge, or any other browser. The reason can be the corrupted temporary data, different CSS encoding, and a third-party Chrome extension that utilizes CSS stylesheets.
To save your changes, press CTRL + S when editing the file.
This happened to me without any iFrame. It turns out that there was a style in my stylesheet giving the background to a particles.js area an empty url. Basically, it said: background-image: url('');
- this was in a completely unrelated area of the css file, but as soon as I commented it out and refreshed the page I could edit the css from developer tools and it showed as coming from the css file, not from a style tag.
Another thing to point out is that when I observed the css file from the Sources tab the css file showed as completely empty. When I saw that, I was able to find the info about the empty url css rule at the following forum post https://groups.google.com/forum/#!topic/google-chrome-developer-tools/Z_TLvpOXrMg
Ok, this seems to happen because my HTML/CSS is in an iframe and I only reload the iframe. When I hard-reload the whole page, the class is not grayed out anymore. Maybe Chrome loses the context, if some of the code comes from the cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With