Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web element inspector (safari / chrome) dimmed css properties

Silly web element inspector (safari / chrome) question, but I can't seem to figure out why some properties are dimmed.

element inspector

like image 642
Lezz Avatar asked Sep 23 '10 08:09

Lezz


People also ask

Why are some CSS properties greyed out?

If a grayed out property appears within a section that says "Inherited from [selector]", then it is a non-inheritable property that is not applied to the current element. Any crossed out property has been overridden by a more specific style.

What does greyed out HTML mean?

Grayed out is the term used for a disabled graphical control element in a graphical user interface. It is often done with a light shade of gray on the specific element. Grayed-out elements help in minimizing confusion for the user regarding an element's status and whether or not it is active or available.

Where can we view the HTML attributes for a web element in the Chrome browser?

One of the easiest ways to inspect a specific web element in Chrome is to simply right-click on that particular element and select the Inspect option. Clicking on the Inspect option from the right-click menu will directly open the Developer tools including the editor, Console, Sources, and other tools.


4 Answers

According to source Webkit inspector apply 50% opacity to css styles that are "inherited" or "implicit", from inspector.css

.styles-section .properties .implicit, .styles-section .properties .inherited {
    opacity: 0.5;
}
  • Implicit are the one that are under a composite property like border: 1px solid red color: red will be grayer.
  • Inherit are the ones with the explicit "inherit" value.

Now the current chrome version seem to color gray some other values, too bad the inspector on the inspector is not working anymore :(

like image 131
Julien Roncaglia Avatar answered Oct 16 '22 10:10

Julien Roncaglia


After looking at it on the link you provided, the faded (dimmed) ones are the style rules that don't have any browser operations linked to them, for example:

Click the little arrow next to background: you get a list of rules that Chrome uses to interpret your CSS.

On float and height, there is pretty much only one way that can be interpreted and so Chrome doesn't need to add any browser specific styles to make it display as intended.

Hope that helps to explain it :)

Faded rules are rules that don't need any special attention from the browser :)

like image 24
Kyle Avatar answered Oct 16 '22 10:10

Kyle


For me it was just a charset mixing problem.

The HTML file itself and one of the CSS files were encoded as UTF-8 with BOM, while other CSS file was encoded as ANSI. I still cannot figure out how Chrome managed to show almost everything right. I switched all of the files back to UTF-8 without BOM and the problem was solved. Thanks to the W3C validator that hinted me on the presence of the BOM.

Hope this helps at least someone else.

like image 1
nobug Avatar answered Oct 16 '22 12:10

nobug


Are you also getting "interpreted as image but transferred with mime type text/css" ? I was.

This solved it: Chrome interprets CSS Stylesheet as image

Basically, if your css file has 'background: url()' or 'background: url("")' in it, just comment them out or delete them (or you know, just put a path in there) The page should then load with the css styles in chrome inspector back as active.

like image 1
Anup Bishnoi Avatar answered Oct 16 '22 12:10

Anup Bishnoi