0

What should be the best precise markup for a pagination structure? should be tables?, div or span?, simple links or other?

NAV STYLE

<nav>
  <a href="#1">1</a>
  <a href="#1">2</a>
  <a href="#1">3</a>
</nav>

LIST STYLE

<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
</ul>

TABLE STYLE or other?

<table>
   <tr>
     <td>1</td>
     <td>2</td>
     <td>3</td>
   </tr>
</table>

I think now we have html5 should be <nav> plus <a> but I'm not sure...

4

2 回答 2

1

我用:

<nav>
    <ul>
        <li>
            ...
        </li>
    </ul>
</nav>

它具有语义意义,并​​且很容易设置样式。

于 2013-04-18T16:21:53.430 回答
1

为了语义上的好处,nav用作外部标签。链接应该是a标签,但它们不需要是nav. 您可以使用列表、表格或普通链接;只要anav.

于 2013-04-18T16:24:39.150 回答