I have achieved a certain CSS shape with clip paths. This shape is actually the border of the div. I want to add text to this border but couldn't find a way to achieve this without removing the border the text occupies. When I add text to the arc div's, the text never seems to appear. If you use a browser like chrome to see where the p tag is being placed, it is actually being placed in the content of the div, which is reasonable, but gets cut off from the way this shape was made. (probably because of overflow: hidden)
body {
display: flex;
justify-content: center;
align-items: center;
}
.palette {
--g:30px; /* The gap between shapes*/
--s:100px; /* the size*/
height: 600px;
width: 600px;
position:relative;
display:inline-block;
overflow:hidden;
margin-top: 50px;
}
.arc1, .arc2, .arc3 {
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
border:var(--s) solid var(--c,red);
border-radius:50%;
clip-path:polygon(
calc(50% + var(--g)/2) 50%,
calc(50% + var(--g)/2) 0%,
100% 0%,
100% calc(78.665% - var(--g)/2),
50% calc(50% - var(--g)/2));
transition: border 0.75s ease-out;
transition: polygon() 0.75s ease-out;
}
.arc2 {
transform:rotate(120deg);
--c:blue;
}
.arc3 {
transform:rotate(-120deg);
--c:orange;
}
.center-circle {
width: 360px;
height: 360px;
background-color: black;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
margin-top: -180px;
margin-left: -180px;
}
<body>
<div class="palette">
<a href="">
<div class="arc1">
<p>This is where I want to put my text</p>
</div>
</a>
<a href="">
<div class="arc2">
</div>
</a>
<a href="">
<div class="arc3">
</div>
</a>
<a href="">
<div class="center-circle">
</div>
</a>
</div>
</body>