Aligning icons (fontawesome)

I want to align the icon to the text, but it seems difficult. I tried vertical-align: middle, but the position of the icon is not very middle. I suppose it's due to the height of CJK characters?
No description
6 Replies
ἔρως
ἔρως3w ago
try setting the font-size to 1lh and if that doesn't work, just do 1 span with 2 spans: the text and icon then, on that span, use grid-inline or flex-inline and center with that it's hacky, but achieves perfect center alignment however, the 1lh should be tried first
露米諾斯 Lumynous
font-size: 1lh just makes icon big
No description
露米諾斯 Lumynous
flex works
ἔρως
ἔρως3w ago
it's very irritating to center text vertically, so, i just use flex-inline or grid-inline when i must but it's good that it worked for you
capt_uhu
capt_uhu3w ago
just as a follow up FYI, There's a spec-ed property set to help us deal with this problem: https://github.com/jantimon/text-box-trim-examples?tab=readme-ov-file Currently in Safari and close to ready in Chrome. Maybe will make Interop this year 🤞
ἔρως
ἔρως3w ago
that does sound interesting
Want results from more Discord servers?
Add your server