Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

font-family is inherit. How to find out the font-family in chrome developer pane?

In the Chrome's developer pane, I can see these css settings of an element.

enter image description here

As far as I can see, every single font-family value is inherit.

How can I find what is the actual value of the font family? And how can I trace the definition of the root font-family value come from the inheritance hierarchy?

like image 427
Anthony Kong Avatar asked Jul 14 '13 07:07

Anthony Kong


People also ask

How do I find my inherit font-family?

Your browser's default font-family will be inherited for that case. You can check the browser default font in chrome: Settings > Web content > Customize fonts...

How do I find my font-family on Google Chrome?

You simply click the Visual Inspector icon in the Chrome menu to activate the tool, then head over to the Typography section in the dropdown. You are now presented with the font families used with an additional breakdown of all the typography within the webpage.

What are inherit fonts?

The inherit option means it will receive the body's font family. To change to a different font family, you can do that from font manager.

What is inherit in font-family CSS?

inherit in CSS simply means it inherits the values from parent element, so for example: <div style="font-family: Arial;"> <p style="font-family: inherit; /* This will inherit the font-family of the parent p*/"> This text will be Arial..And inherit is default behavior of the browser </p> </div>


2 Answers

Developer Tools > Elements > Computed > Rendered Fonts

The picture you attached to your question shows the Style tab. If you change to the next tab, Computed, you can check the Rendered Fonts, that shows the actual font-family rendered.

Developer Tools > Elements > Computed > Rendered Fonts

like image 160
Rafael Eyng Avatar answered Sep 22 '22 05:09

Rafael Eyng


The inherit value, when used, means that the value of the property is set to the value of the same property of the parent element. For the root element (in HTML documents, for the html element) there is no parent element; by definition, the value used is the initial value of the property. The initial value is defined for each property in CSS specifications.

The font-family property is special in the sense that the initial value is not fixed in the specification but defined to be browser-dependent. This means that the browser’s default font family is used. This value can be set by the user.

If there is a continuous chain of elements (in the sense of parent-child relationships) from the root element to the current element, all with font-family set to inherit or not set at all in any style sheet (which also causes inheritance), then the font is the browser default.

This is rather uninteresting, though. If you don’t set fonts at all, browsers defaults will be used. Your real problem might be different – you seem to be looking at the part of style sheets that constitute a browser style sheet. There are probably other, more interesting style sheets that affect the situation.

like image 40
Jukka K. Korpela Avatar answered Sep 25 '22 05:09

Jukka K. Korpela