TomJava
TomJava

Reputation: 529

How to identify the font the browser rendered

I have a css like

body ,html ,* {
font-family: "MyTest1","MyTest2","Helvetica Neue","Helvetica","Arial",sans-serif !important;
}

How to identify from the above fonts which one the browser rendered the page finally?

Upvotes: 0

Views: 87

Answers (3)

roberrrt-s
roberrrt-s

Reputation: 8210

A way to log this information in the console would be using window.getComputedStyle().

Example:

var text = document.querySelector('.hello-world');
var style = window.getComputedStyle(text)
console.log(style.fontFamily)
.hello-world {
  font-family: Verdana, Arial, sans-serif;
}
<p class="hello-world">Hello, world!</p>

Upvotes: 0

Andrija Ćeranić
Andrija Ćeranić

Reputation: 1713

You can check it out in Chrome Dev Tools in Elements tab and than at the bottom will be Rendered Fonts.

Upvotes: 2

Bhargav Chudasama
Bhargav Chudasama

Reputation: 7161

in browser developer option available

inspect element using mouse right click or F12 function key you can see which font is apply in Elements option

Upvotes: 1

Related Questions