提问人:Jeff 提问时间:10/26/2022 最后编辑:Jeff 更新时间:10/26/2022 访问量:37
在 getComputedStyle() 上获得意外结果
Getting an unexpected result on getComputedStyle()
问:
知道为什么并返回“Times New Roman”吗?我的代码在浏览器中运行。bodyFontFamily
test
let bodyTag = document.querySelector("body");
let bodyTagStyles = window.getComputedStyle(bodyTag);
let bodyFontFamily = bodyTagStyles.fontFamily; // returns "Times New Roman"
let test = bodyTagStyles.getPropertyValue("font-family"); // returns "Times New Roman"
let foo = bodyTagStyles.font; // returns '16px "Times New Roman"'
扩展节目bodyTagStyles
fontFamily
= "Monserrat, sans-serif"
页面的 URL 已 https://demo.directadmin.com:2222/login
该页面具有用于演示目的的自签名证书。
答: 暂无答案
评论