3
I know CSS evolves slowly, but I’ve seen a lot of new things out there, especially with the more modern browsers that accept very new properties.
My question is whether there is already any way to put a text inside a shape
. Currently it is already possible to place a text inside a circle as in the image below?
The ball can be made with border-radius
, but to make the text accompany the shape of the circle? How to make the text be contained or insert the text into a circular shape, or a div
with a certain shape
?
Example I tried:
.box {
width: 300px;
height: 300px;
border-radius: 50%;
border: 1px solid #000;
margin: auto;
text-align: center;
}
<div class="box">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tenetur ipsum in aut blanditiis iusto aspernatur odio ad officia. Ipsam, recusandae repellendus tempora magni obcaecati vero nostrum dolorem molestias libero repellat debitis cupiditate sequi rem provident accusantium dolore modi hic ut neque. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam mollitia, sapiente numquam quos tenetur facilis odit dolorum accusamus, at ducimus nemo, corrupti pariatur? Reiciendis exercitationem quibusdam voluptatum assumenda ullam voluptas.
</div>
I saw it here: https://teamtreehouse.com/community/force-text-to-respect-the-boundaries-inside-of-a-circle
– Laércio Lopes
There is an option using SVG as code snippet: https://codepen.io/noahblon/pen/pjvPPN
– Vinicius Dutra
It was worth the touch @Laérciolopes but it’s not much what I imagine, there we can say basically that the guy was lucky with the rss alignment
– hugocsl