How is an element inline
you can use vertical-align: super
It would look like the image below.
Below I talk more about top/top
Follows code from the image
<h3 style="font-size:40px; font-color: #000;">
<span>CVS<span style="font-size:24px; vertical-align: super">®</span> - </span>
</h3>
Over Explain
Note that every text creates a "text box" where the content is inside.
That one caixa de texto
is defined by descender line
and ascending line
and may vary from font-family
for font-family
, because it is intrinsic to the source archive (.ttf
or .otf
).
Although there is no typographical rule, and neither does the W3C, that says you have to align the ®
in the top
or in the super
See how it is aligning the ®
to 100%
of vertical-align
, he "glue" on top of caixa de texto
, and not at the "top of the text"
See how between two typographical families you can have a different "anatomy". Here we have the Time New Roman
and the Verdana
, the two of the same size 20pt
, but visually they have different size, this was defined by the font design and is something referring to the file itself...
Here’s an article more related to typography, but there’s A LOT of interesting stuff about the history of typography, and why Fig decide to change their understanding of line-height
and how it is rendered. https://www.figma.com/blog/line-height-changes/
OBS: According to Mozilla the tag <sup>
should not be used for this, although visually look like, is not a tag made to treat wordmark.
to stylize the wordmark of a company or product that uses a high baseline should be done using CSS (most likely vertical-align
) instead of <sup>
.
Proper use of tag <sup>
- Exponents type 3²
- Language abbreviations as in French "mademoiselle" = "Mlle"
- Ordinal numbers as 4°
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup#Usage_notes
And perhaps it is worth mentioning that thus will be used the typographical line that defines the rise to height, not the cap height, which justifies the symbol being higher than the capital letters.
– Woss
@Andersoncarloswoss I’m working on it, I found some interesting things
– hugocsl
I took my vote just so I could vote again +1
– Woss
@Andersoncarloswoss haha :D was worth young, I took the opportunity to include a few more words. This "text box" thing was something I had noticed. Even includes an extra GIF.
– hugocsl
+1 for the gifs :)
– Davi Wesley
@Daviwesley haha, sometimes we have to explain "drawing"... vlw
– hugocsl
Caraca, this was the most complete answer I’ve ever seen. Congratulations too!!! and it was worth too much also!!
– Gabriel Ramalho Grotto
@Gabrielramalhogrotto was worth the young force! At first I thought it would be a simple answer, but I noticed several details that I took the opportunity to explain more fully, []’s
– hugocsl