How to display text, a dotted line then more text spanning the width of the page?

前端 未结 6 1907
遇见更好的自我
遇见更好的自我 2020-11-29 10:38

I\'d like to display some text then a dotted line then some more text on the same line on a HTML page e.g.

Name: ............................................         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 11:17

    LeftRight

    Some textsome bad text


    .dotbg{
        line-height: 12px;
        background: url('http://i.stack.imgur.com/L8CQg.png') bottom repeat-x;    
        width: 250px; /* this is only for showcase */
        margin: 0 auto 1.5em auto; /* this is only for showcase */
    
    }
        .dotbg span{
            padding: 0 5px; 
            background: #fff;
        }
        .dotbg .right{
            float: right;
        }
    

    Preview: http://jsfiddle.net/E7cyB/1/

提交回复
热议问题