hide line beginning and end text separators

后端 未结 3 1071
南旧
南旧 2020-12-30 05:33

two solutions below: one with pure css, the second with jQuery, allowing any kind of symbol/image to be a separator

pre: Fairly hard to formulate an

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 06:11

    Here's an idea: http://jsfiddle.net/WyeSz/
    (note that the jsfiddle demo uses a CSS reset, you may need a little more CSS than this to reset list styles, etc.)

    Basically, you set border-left on the list items, then position the entire list -1px to the left within a container that has overflow:hidden, which cuts off the left borders.

    • C++
    • PHP
    • CSS
    • ASP
    • JavaScript
    • jQuery
    • HTML 5
    • StackOverflow
    ul {
        width:200px;  
        margin-left:-1px;/* hide the left borders */
    }
    li {
        float:left;   
        padding:2px 10px;
        border-left:1px solid #000;
    }
    div {
       overflow:hidden;/* hide the left borders */  
    }
    

提交回复
热议问题