Home > Web Front-end > JS Tutorial > body text

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

零下一度
Release: 2017-06-28 10:24:38
Original
3953 people have browsed it

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>
Copy after login

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");;
        
    })
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template