TE
TechEcho
AccueilTop 24hRécentsMeilleursQuestionsPrésentationsEmplois
GitHubTwitter
Accueil

TechEcho

Une plateforme d'actualités technologiques construite avec Next.js, fournissant des nouvelles et discussions technologiques mondiales.

GitHubTwitter

Accueil

AccueilRécentsMeilleursQuestionsPrésentationsEmplois

Ressources

HackerNews APIHackerNews OriginalNext.js

© 2025 TechEcho. Tous droits réservés.

Decorative Text Within HTML

79 pointspar tobril y a 3 jours

3 comments

_bentonil y a 3 jours
My favourite is using emojis for classes. It's pointless but I think it's funny and that's gotta count for something right?
评论 #44163425 未加载
spankaleeil y a 3 jours
I would double check that this doesn&#x27;t have performance implications before going wild. Those are extra tokens that need to be parsed, and browsers do a lot of work to speed up selector matching, including building caches of class names to nodes.<p>It <i>could</i> be that browsers populate these caches even for unused class names because it&#x27;s difficult to know at that point in time whether a class name is used or will be used in the future. A ton of unused class names could explode the cache, evict important classes... who knows?<p>It could also be that the cache is built on demand as selectors are matched and having a ton of unused classes doesn&#x27;t matter at all.<p>The point is that it&#x27;s quite implementation dependent and requires some testing to know. To be safe, I&#x27;d just stick to comments because they are very, very cheap, in all browsers and parsers.
评论 #44164464 未加载
someothherguyyil y a 3 jours
&gt; Yes. That is perfectly valid HTML.<p>not a wild revelation, <a href="https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;dom.html#global-attributes:classes-2" rel="nofollow">https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;dom.html#global-attri...</a>