你像他那样,把 CSS 写到单独的文件里面,然后使用 link 标签引入,就可以复现了。 * * * 另外发现,直接在页面写 style 标签的话,只要触发了对应的样式计算(Recalculate Style),也是可以的。 Hello const el = document.querySelector('.box'); // 1 getComputedStyle(el).fontSize; // 2 console.log(el.style.fontSize); // 3 console.log(el.offsetHeight); .box { font-size: 10em; transition: 2s; }