我应该使用 <main> 元素吗?

Should I use the <main> element?

我在 w3schools 上偶然发现了该元素,但据 caniuse.com 告诉我,IE、Opera Mini 和 Android 的 UC 浏览器不支持该元素。

使用 <main> 元素会更好还是应该坚持使用 <div id="main">

caniuse.com told me, the element isn't supported by IE, Opera Mini and the UC Browser for Android

这不是它说的。

它说 "Partial support" 和:

Partial support refers to missing the default styling, as technically the elements are considered "unknown". This is easily taken care of by manually setting the default display value for each tag

因此,如果 main 具有适当的语义,则使用它。只需确保明确设置 display: block.

如果浏览器不公开使用 main 的语义,那么它将没有语义,这与 div 相同。

来自the looks of it I wouldn't worry about compatibility, unless you are trying to support IE 8 and below.. You can cover all your bases by using both <main role="main"> per MDN

The element is widely supported. For Internet Explorer 11 and below, it is suggested that an ARIA role of "main" be added to the element to ensure it is accessible (screen readers like JAWS, used in combination with older versions of Internet Explorer, will be able to understand the semantic meaning of the element once this role attribute is included).