获取浏览器中的默认字体

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Document</title>

</head>

<body>

<div id='foo'>

CSS default style in borwser!

</div>

<script>

var cssAll = window.getComputedStyle(document.getElementById('foo'))./*获得浏览器的全部样式*/

var css = window.getComputedStyle(document.getElementById('foo')).fontSize;

console.log(css);

</script>

</body>

</html>

获取浏览器中的默认字体