Move floated area inside paragraph

前端 未结 1 1223
深忆病人
深忆病人 2021-01-14 18:42

I would like to have a quote positioned inside one paragraph

\"like.

I feel like my co

相关标签:
1条回答
  • 2021-01-14 19:19

    This can be achieved using shape-outside combined with float. Float alone cannot achieve this:

    .wrapperSingleProject {
      width: 400px;
      margin: 0 auto;
    }
    
    p {
      font-size: 17px;
      font-family: 'Roboto', sans-serif;
      font-weight: 400;
      letter-spacing: 0.08em;
      line-height: 1.45;
    }
    .quote-div {
      float: left;
      padding-top:200px; /*Distance from top*/
      margin-right:10px;
      /* A rectangular shape offseted by 200px from the top*/
      shape-outside: polygon(0 200px,100% 200px, 100% 100%,0 100%);
    }
    .quote-div p {
      position: relative;
      text-align: center;
      width: 200px;
      color: blue;
      background-color: #ccc;
      margin:0;
      padding:5px;
      margin-left:-100px;
    }
    <div class="wrapperSingleProject">
      <div class="quote-div">
        <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr</p>
      </div>
    
      <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
        sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
        Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos
        et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
        </p>
    </div>

    0 讨论(0)
提交回复
热议问题