<html>
<head>
<style>
h2::first-letter {
font-size: 48px;
}
</style>
</head>
<body>
<h1>Window 对象</h1>
<h2 id="test" style="background-color:lightblue">
getComputedStyle() 方法
</h2>
<p>测试元素中 div::first-letter 的计算字体大小为:</p>
<p id="demo"></p>
<script>
const element = document.getElementById("test");
const cssObj = window.getComputedStyle(element, ":first-letter")
let size = cssObj.getPropertyValue("font-size");
document.getElementById("demo").innerHTML = size;
</script>
</body>
</html>