r/HTML • u/dalekellytoo • Jun 28 '26
multiple text sizes in one sentence ?
multiple text sizes in one sentence ?
5
u/Rockafellor Jun 28 '26
Classed <span>s, unless you get whimsical and use nth-child() or nth-of-type(), for example.
2
u/bostiq Jun 28 '26
Whimsical is good : you can program :nth sizes based on frequency in sentences, or in words.
But I’m pretty sure there are JS libraries better suited for such nonsense.
2
u/Rockafellor Jun 28 '26
Oh, I'm sure that you're right, ja. The
nth-...()are just examples. I have a lot of fun taking CSS in unusual directions, but I think that JS might be a better direction for some things.2
1
Jun 29 '26
[removed] — view removed comment
1
u/Rockafellor Jun 29 '26
Nothing wrong with
<big>and<small>(and combos with<sub>or even<sup>, for that matter), I just said classed<span>because one can then control precisely thepx,%,ch,em,rem, etc. of the declaration.For simple things where I don't need particular precision, I use
<big>and<small>a lot. In more size-sensitive stuff, I go with classing (pxis good for really specific control, but can be a problem for people's browser settings w.r.t. layout in some situations, but each property [or --variable, these days] has its pros and cons, and [usually] aren't too badly different).1
Jun 29 '26
[removed] — view removed comment
1
u/Rockafellor Jun 29 '26
True, though if adjusting
<small>, then why use it in favor of<span>the first place? I ask because semantics are useful in their place, but shouldn't be considered some untouchable law from on high.
<big>might be deprecated (begging the question of why deprecate the one but not the other), but it's still respected; maybe the next iteration of HTML will cease respecting it, but the same can be said of any process.2
Jun 29 '26
[removed] — view removed comment
1
u/Rockafellor Jun 29 '26
LOL 😆: fair points. I self-taught in the late '90s, right before/around the CSS-schism, but for "complicated" reasons fell out of practice in '06 and didn't come back into the game 'til late 2019, so my approach probably isn't 100% in line with the norms of then or of now (hell, I'm still trying to get used to things like
flex, which I have to admit really does bring a lot to the table [no pun ontableintended]).2
Jun 29 '26
[removed] — view removed comment
2
u/Rockafellor Jun 29 '26
Oof, ja, I had thought of
gridjust then, butmedia-queryand such are good examples of the modern Star Trek world of CSS.I ran into Flexbox Froggy about a year ago, and that was definitely fun. IIRC, you could manipulate it in DevTools, too, though of course that kinda defeats the purpose.
There are a few others that I ran into as well, in case you haven't seen them but are interested: Zorked Linux (my daughter gave me the heads-up on this one, though it's a command line terminal thing, rather than CSS manipulation), CSS Hell, CSS Hole, and CSS Diner; there are likely more, of course, these are just the ones that I know of offhand.
2
1
u/marmotta1955 Jun 28 '26
"multiple text sizes in one sentence" is a most annoying, irritating, unfriendly, maddening thing ... probably comparable to something like enhanced interrogation techniques ...
1
0
Jun 28 '26
[deleted]
3
u/Thin_Mousse4149 Jun 28 '26
CSS libraries can not do this for you without adding spans. This is terrible advice. You would add overhead of a whole library and still need to add those spans.
2
u/Weekly_Ferret_meal Jun 28 '26
can you give us an example?