我不确定在<summary>
标签内使用<h2>
标签是否正确。
在语义上,在<summary>
标签内部使用<h2>
或<h1>
标签是否有效?
我不确定在<summary>
标签内使用<h2>
标签是否正确。
在语义上,在<summary>
标签内部使用<h2>
或<h1>
标签是否有效?
当然可以,但您需要使用CSS进行一些样式设置以避免换行。要测试可用性,请使用W3-Validator并使用W3Schools。
<!DOCTYPE html>
<html>
<head>
<title>HTML Summary usage</title>
</head>
<body>
<details>
<summary><h1>Copyright 1999-2014.</h1></summary>
<p> - by Refsnes Data. All Rights Reserved.</p>
<p>All content and graphics on this web site are the property of the company Refsnes Data.</p>
</details>
<p><b>Note:</b> The summary element is not supported in Edge/Internet Explorer.</p>
</body>
</html>