user3133281
user3133281

Reputation: 31

How to add a border at the bottom of every <li>?

I want to add a border to the bottom of every list item, however it appears to only add it to the bottom of the entire list: a

here is my code: http://scratchpad.io/abusive-stage-1825

Thanks.

Upvotes: 0

Views: 244

Answers (3)

iamjawa
iamjawa

Reputation: 129

If the above two answers do not work for you, which they should, you could always set li's as their own separate class and then refer to that in your CSS.

Upvotes: 0

Saurabh Saluja
Saurabh Saluja

Reputation: 290

may be this may help you, try adding li{border:1px solid red;width:50px;}

<!DOCTYPE html>
<html>
<body>
<style>
li{border:1px solid red;width:50px;}
</style>
<h4>An Unordered List:</h4>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>

</body>
</html>

Upvotes: 0

beautifulcoder
beautifulcoder

Reputation: 11330

This should do it:

li { border-bottom: 1px solid black; }

Upvotes: 1

Related Questions