Why should I use UL/LI in my HTML?

前端 未结 9 1195
长发绾君心
长发绾君心 2021-02-13 13:04

I have the following structure that seems really nice for me and I always use HTML5:


      
9条回答
  •  有刺的猬
    2021-02-13 13:34

    Tags are not only for presentation (which can be deeply changed today, anyway) but also for meaning. You can almost (?) do a complete Web page with only div and span, for example, but it doesn't mean it is a good idea...

    You mention HTML5: they went great lengths to add several tags with similar rendering, but very different semantical meaning.
    As written above, this helps screen readers: they will read differently your coding, perhaps trying to read it as a whole sentence, while they will read a real list with proper tone and pauses.
    But it might also help web spider (think "Google", but not only) to better grasp the structure of your page and better index the most important parts.

提交回复
热议问题