我一直在某些人的工作中看到角色屬性。我也使用它,但是我不確定它的效果。例如:<header id="header" role="banner"> Header stuff in here</header>要么:<section id="facebook" role="contentinfo"> Facebook stuff in here</section>要么:<section id="main" role="main"> Main content stuff in here</section>此角色屬性是否必要?這個屬性對語義更好嗎?它會提高SEO嗎?可以在此處找到角色列表,但我看到有人組成了自己的角色。是否允許或正確使用role屬性?有什么想法嗎?
HTML中“角色”屬性的目的是什么?
慕工程0101907
2019-09-27 16:19:19