Is there a way to set an inner shadow for a geometric shape with text inside?
This is what I need to achieve:
I used the code from here: https://stackoverflow.com/questions/27730055/required-pentagon-shape-with-right-direction-css-and-html
If the figure consists of diva and triangle (option below), I can set the shadow only for diva. But even if I could give a shadow to the triangle, the border between the figures would be visible.
div { position: relative; width: 125px; height: 150px; background: #4275FF; -moz-box-shadow: inset 0 0 10px #000000; -webkit-box-shadow: inset 0 0 10px #000000; box-shadow: inset 0 0 10px #000000; } div:after { content: ''; position: absolute; width: 0; height: 0; border-top: 75px solid transparent; border-bottom: 75px solid transparent; border-left: 25px solid #4275FF; right: -25px; }
<div></div>
If I use the swg method, I can create an internal shadow using box-shadow, but the triangular part of the figure will not cast a shadow again. (And besides, changing the proportions of the figure is inconvenient in this case).
div { width: 150px; height: 150px; background: #4275FF; -moz-box-shadow: inset 0 0 10px #000000; -webkit-box-shadow: inset 0 0 10px #000000; box-shadow: inset 0 0 10px #000000; }
<svg width="150" height="150"> <defs> <clipPath id="shape"> <path d="M0,0 h125 l25,75 l-25,75 h-125z" /> </clipPath> </defs> <foreignObject clip-path="url(#shape)" width="100%" height="100%"> <div></div> </foreignObject> </svg>