0

Here my codepen: https://codepen.io/joondoe/pen/qzEBWw

I would make the text breaks line at the border my circle, so far even the overflow-wrap property fails.

here my snippet:

.circle {
  width: auto; 
  padding-bottom:100%;
  border-radius: 50%; 
  overflow:hidden;
  border: 3px dashed salmon;
  position:relative;
  display:flex;
  flex-direction:column; 
  background:green;
}

.content{
  width:100%;
  text-align:center;
  box-sizing: border-box;
  object-fit:fill;
  overflow-wrap:break-word;

  background-clip:padding-box; 
  position: absolute; 
} 
<div class="circle"> 
  
  <div class="content" >
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
  </div>
  <!--
 <img
    class="circle__img"     
    src="https://3c1703fe8d.site.internapcdn.net/newman/gfx/news/hires/2017/chemistexpla.jpg"
 />

  
  
  <div class="circle_background" ></div>
  -->
</div>
Webwoman
  • 10,196
  • 12
  • 43
  • 87

1 Answers1

0

CSS overflow only understands rectangles.

I've never tried this, but you can use CSS shapes to accomplish this.

.circle {
  shape-outside: circle(50%);
  width: 300px;
  height: 300px;
  float: left;
}

See:

https://www.sarasoueidan.com/blog/css-shapes/

https://www.html5rocks.com/en/tutorials/shapes/getting-started/

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176