Advanced CSS challenge: underline only the final line of text with CSS

后端 未结 6 1127
野的像风
野的像风 2020-12-14 10:58

I want to underline the final line of multi-line text, or at least create the allusion of it. Look closely at the following examples, because I\'m trying to do something tri

6条回答
  •  旧巷少年郎
    2020-12-14 11:00

    Here's a variation on what @albert was doing. It uses the p:after{} trick but with different display. The

    seems to have to be position:relative; to work.

    
    

    first line of test text which is long enough to stretch onto a second line .

    http://jsfiddle.net/VHdyf/

    One cool thing about this approach is that it still uses border-bottom, which I prefer to using underline in most cases.

提交回复
热议问题