问题描述
我正在查看 html 参考页面,他们在其中放置了有关 HTML 标签的所有描述。它说“该标签指定了自包含的内容,如插图、图表、照片、代码列表等。”我不明白什么是代码清单。它实际上意味着该定义中的代码列表吗?
解决方法
这意味着在页面上列出代码
<figure>
<figcaption>Get browser details using <code>navigator</code>.</figcaption>
<pre>
function NavigatorExample() {
var txt;
txt = "Browser CodeName: " + navigator.appCodeName + "; ";
txt+= "Browser Name: " + navigator.appName + "; ";
txt+= "Browser Version: " + navigator.appVersion + "; ";
txt+= "Cookies Enabled: " + navigator.cookieEnabled + "; ";
txt+= "Platform: " + navigator.platform + "; ";
txt+= "User-agent header: " + navigator.userAgent + "; ";
console.log("NavigatorExample",txt);
}
</pre>
</figure>