The main css property is border-right
border-right:1px solid gray;
padding-right:10px;
padding-left:10px;
<div data-bind="foreach:RequestListAll"> <a class="PositionName" style="display: block;color:gray; float: left; font-family: 微软雅黑; font-size: 14px;border-right:1px solid gray;padding-right:10px;padding-left:10px;" data-bind="text:PositionName,click: $root.ViewDetail"></a> </div>
Using this style, generally text and slashes will appear in a bunch, resulting in a vertical line appearing later, which looks ugly. Use jQuery removes the last one too
$(function () { $(".PositionName").last().css("border-right", "none");; })
The above is the detailed content of How to set a small vertical line in the middle of text in css?. For more information, please follow other related articles on the PHP Chinese website!