lundi 20 décembre 2021

CSS guidelines about repeatitive structures vs particular instances

Here are 3 equivalents pages:

  1. https://jsfiddle.net/a1g6cfdk
  2. https://jsfiddle.net/04dqzf8a
  3. https://jsfiddle.net/06hfwbm4

I think 1) is the "classic" way of doing, and 3) is being "too smart".

I'm not a fan of 1) because I feel that we repeat "page", I kinda like 2 because the HTML is "cleaner".

I just realised I could also create page elements like this:

https://jsfiddle.net/2j9kvbem

<html>
<body>
  <page id="page1"></page>
  <page id="page2"></page>
  <page id="page3"></page>
</body>
</html>

Maybe that's the cleanest: the HTML tag to express the repeative structure and CSS to express the particularities.

Is there a guide somewhere which would list CSS conventions/architecture guidelines reguarding this topic?

Aucun commentaire:

Enregistrer un commentaire