Border Height on CSS

前端 未结 12 1029
既然无缘
既然无缘 2020-12-12 21:55

I have a table TD and on the right of it I want to add a 1 pixel border, so I\'ve done this:

table td {
    border-right:1px solid #000;
}

12条回答
  •  再見小時候
    2020-12-12 22:20

    No, there isn't. The border will always be as tall as the element.

    You can achieve the same effect by wrapping the contents of the cell in a , and applying height/border styles to that. Or by drawing a short vertical line in an 1 pixel wide PNG which is the correct height, and applying it as a background to the cell:

    background:url(line.png) bottom right no-repeat;
    

提交回复
热议问题