4
I was wanting to create a title to use in the sessions of my site, but wanted the source to have an effect similar to those images, With eyes filled giving the impression that the source has the inside of the characters filled.
With CSS there is some practical way to fill the letters inside?
Or I have to resort to other resources?
TEST
I ran some tests with text-shadow
but I did not reach an applicable result...
h1 {
color: blue;
font-size: 100px;
font-family: sans-serif;
text-shadow:
8px 8px 0 red,
16px 16px 0 red,
22px 22px 0 red;
}
<h1>AaBbDdOoPpQqR</h1>
I think the valid way would be to create a layer behind the text by filling in the holes only
– Giovanni Dias
@Giovannidias I tried in some ways, like "clip" that red part that’s out of the text, but I couldn’t... Or use a
inset text-shadow
, but I couldn’t do it...– hugocsl
see this idea in this post, https://stackoverflow.com/questions/30375406/to-add-bg-color-inside-the-space-of-an-single-letter-in-a-word,
– user60252
@Leocaracciolo It is an idea, but it would have to be made a class for each letter.. besides I don’t know if separating a character with span would keep the semantics of the whole word...
– hugocsl
it is, but it was the only thing I found on the net! It’s only 23 letters. Hahaha Alias, less than 23 pq some have no holes
– user60252
I will summarize, any answer is something quite laborious that is often unnecessary, the best is to look for a font that follows exactly this style you want, but is just suggestion.
– Guilherme Nascimento
@Guilhermenascimento I think this time to the solution eh around in dafont.com I’ve found some and then eh just generate a font-face Pack on some site like fontsquirrel.com
– hugocsl
Surely many solutions can and should be like this, certain things in CSS break the expected behavior, for example the positioning of the text can be affected and "break" making the "mask" that used to plug the holes stay elsewhere, the control is much more difficult, remember that a few years ago they were using a JS+Canvas+CSS technique to load custom external fonts for websites, if the effect of "Blink" is still noticeable with
@fonte
, imagine with a JS solution "mirabolante", has time that it is better to simplify :)– Guilherme Nascimento
hahaha is sad no, I made a letter generator without holes, see http://kithomepage.com/sos/letras-sem-buracos.php
– user60252
@Leocaracciolo very good, it was really cool! You have to build the list of classes before right? And he takes the string in the array list and puts the class? Must have given a "work" rss, but it was nice congratulations!
– hugocsl
Nothing laborious, see
$novaFrase = str_split($frase);
and henceforeach( $novaFrase as $value ){
 if( $value === 'a' ){
 $novaFraseConvertida .='<span class="fill-letter a">a</span>';
 }else if ( $value === 'A' ){ ......
– user60252
@Leocaracciolo I’m just in the arrays and loops class, very cool to see this example! Thanks for sharing and giving the trouble!
– hugocsl
put the whole code in a textarea for you to see, access the link again
– user60252
Note: without the
<!DOCTYPE html>
doesn’t look good, no– user60252
Thanks again @Leocaracciolo thanks ;)
– hugocsl