Home >Web Front-end >JS Tutorial >How to set a small vertical line in the middle of text in css?

How to set a small vertical line in the middle of text in css?

零下一度
零下一度Original
2017-06-28 10:24:384035browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn