0
I would like to make a bas-relief effect on a text. Using the property text-shadow
it is possible to do this, as shown below:
.box{
font-family: Arial;
background: #bababa;
text-shadow: 1px 1px 1px #fff;
font-size: 4em;
font-weight: bold;
padding: 20px;
}
<div class="box">
Texto
</div>
The problem is that in my project, the div where the text is has a clearer background than in the above example (background: #f5f5f5;
), and with it, the effect of text-shadow
is imperceptible due to the low contrast between the background
and the color of text-shadow
, see:
.box{
font-family: Arial;
background: #f5f5f5;
text-shadow: 1px 1px 1px #fff;
font-size: 4em;
font-weight: bold;
padding: 20px;
}
<div class="box">
Texto
</div>
It would be something similar to the value inset
of property box-shadow
, but the box-shadow
only applies to content tags (div
, span
etc.) and not the texts.
Is it possible to do this low-relief effect on CSS texts? How?
Sam would be interesting to include in your question an image with an example as close as possible to what you want, because there are various techniques and various styles of low and high relief
– hugocsl
Hi Hugo! Snippet is not enough?
– Sam
I don’t think Sam ate Pq in his own answer you say you found a Codepen with effect "similar" to what you want, so neither your snippet, nor the codepen seem to be what you want... Therefore, it would be nice to include an image for us not to waste time giving you an answer that tbm eh what you have in mind, since the effect can be done with different shapes and techniques with the I spoke...
– hugocsl
@hugocsl So it would be something similar to the first snippet, and the Codepen that I found was content with the internal shading, because, at least at first, the issue of the contrast of the white shadow with the background, which would give the effect shown in the snippet, is what hurts.
– Sam