Horizontal Line in Background using Css3

前端 未结 8 1329
走了就别回头了
走了就别回头了 2021-02-07 08:05

How to implement this type of style to text using only css3, means a horizontal line in the middle of the tag... Can it be possible using pure css...

8条回答
  •  失恋的感觉
    2021-02-07 08:28

    One of the simplest way I know, you can achieve this like this:

    HTML

    Your text goes here


    CSS

    p {
        background: #fff; // or whatever is your bg-color
        display:inline-block;
        padding-right: 1em;
        line-height: 1.2em;
    }
    
    p+hr {
        margin-top: -0.6em;
    }
    

    JSFiddle http://jsfiddle.net/cTMXa/1/

提交回复
热议问题