Line of dots between items

前端 未结 6 1311
别那么骄傲
别那么骄傲 2021-02-14 17:54

Restaurant web site and menu. I need to get \"line of dots\" between menu item and price. I need to get it without writing dots manually one by one. This feature should work aut

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-14 18:57

    I think you look for something like this:

    html

    Marinated Olives
    4.00E

    css

    .dot{
        border-bottom: dotted 3px orange;
        width: 100px;
        float: left;
        position: relative;
        display: block;
        height: 12px;
        margin: 0 5px 0 5px;
    }
    
    div:first-child, div:last-child{
        float:left;
    }
    

    fiddle

    You can play with width to adjust in your likes.

    Also another approach using css :after

    html

    Marinated Olives
    4.00E

    css

    div{
        float:left;
    }
    
    #dotted::after{
        content: "..................";
        letter-spacing: 4px;
        font-size: 18px;
        color:orange;
        margin-left:20px;
    }
    

    fiddle

    Here you can play with content and letter-spacing. Hope it helps :)

提交回复
热议问题