如何在我的底部菜单栏中添加border-right?

时间:2012-01-14 11:25:55

标签: html css

我在网站上有以下代码:

<table width="70%" cellpadding="0" cellspacing="0" align="center"><tr>
<td >Home</td>
<td>About Us</td>
<td>Services</td>
<td>Gallary</td>
<td>Contact Us</td>
<td>Enquiry</td>
</tr>
</table><br/>

我想在每个菜单中添加相等空格的border-right。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

我相信这个CSS就是你所要求的:

td
  { border-right: solid 1px black;
    text-align: center;
    }
td:last-child
  { border-right: none; }

Check out this JSFiddle。请注意,td:last-child选择器不适用于所有浏览器。

但是,您应该放弃使用表格作为布局元素。

相关问题