My current CSS code is designed to create circular shapes:
.circle {
background: #f00;
width: 100px;
height: 100px;
border-radius: 50%;
display: inline-block;
text-align: center;
line-height: 100px;
margin:5px;
}
By utilizing this code in html
, I am able to generate three circles placed next to each other with text enclosed inside them:
<div class="circle">Text1</div>
<div class="circle">Text2</div>
<div class="circle">Text3</div>
resulting in the following layout:
https://i.sstatic.net/yWWOl.png
However, when attempting to add more text inside the second circle, the text overflows as shown below:
<div class="circle">Text1</div>
<div class="circle">Text2 and more</div>
<div class="circle">Text3</div>
https://i.sstatic.net/cZvKm.png
I am seeking a solution where 'Text2 and more' can remain within the confines of the second circle while wrapping around. How can this be accomplished?
It is important to note that I prefer not to use display: table-cell
since it does not respond well on various screen sizes and might disrupt the overlapping arrangement of circles on narrow viewport pages.