CSS text ending indentation

前端 未结 2 828
忘了有多久
忘了有多久 2021-01-13 13:48

I\'m trying to achieve the red highlighted effect with CSS. The first row to be the longest, the second shorter and so on.

https://codepen.io/make96/pen/QmMJyx

2条回答
  •  广开言路
    2021-01-13 14:47

    There is something called shape-outside that can help to do this but of course not well supported :

    .shape {
      shape-outside: polygon(0 300px, 300px 0, 300px 300px);
      width: 300px;
      height: 300px;
      float: right;
    }
    
    p {
      text-align: justify;
    }

    lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume

提交回复
热议问题