开发者

Having trouble adding gaps in between li tags

  <ul>
            <li><a href="#">Brantford Grandview</a></li>
            <li><a href="#">Brantford Vintage</a></li>
            <li><a href="#">Kingston <br/>River P开发者_StackOverflowark</a></li>
            <li><a href="#">Paris</a></li>
        </ul>

It's a pretty basically drop down menu Im building. Right now, I'm just adding a top border to every li giving it a grey line. However, what I want is a 1or 2px gap between the links so the user can see the bg behind. I tried add a div tab in between the li with a height of 1px, but it does not work.

Thanks


A padding inside the li would work.

 li{
    padding-top:2px;
 }

would leave a 2px space inside the li and show the background.


It's hard to tell without seeing the CSS, but I would try fooling around with margin-top or something. It mainly depends on what element the background is being applied to, in your case you would need to apply it to the <li>. Let me know if I need to elaborate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜