4 ms·
html uses class/id attributes to regroup elements which behave the same way. This is part of html.
by jerome_etienne 16y ago
html uses class/id attributes to regroup elements which behave the same way. This is part of html.
- pilif 16y agoyes. But you are supposed to be semantic when handing out classes and ids. So don't use <h1 class="grid_2"> but just <h1>. Don't use <td class="rightalign">, but <td class="number">. And so on. Also, you shouldn't add divs at will because correct styling requires it. You are supposed to be able to style whatever the structure of a given page looks like with just CSS (this still isn't possible due to IE's crappy selector engine). If you are willing to compromise on class names (grid_2), why are you not also willing to compromise on tag names (<table><tr><td>, even <font>)? Again, playing devils advocate. It's not my intention to be trolling, but to discuss the issue and to illustrate my general dislike for these grid systems. I'm NOT advocating going back to soups of tables if it's only for better reusability of site components (which, again, is hampered by this grid_<number> nonsense)
- jamesbritt 16y ago"But you are supposed to be semantic when handing out classes and ids." Yes, in order to achieve certain goals, not because there is some absolute Platonic ideal correctness about it. A question, then is does the pragmatic use of grids to more easily obtain certain layout goals end up making things worse in the long run. Adherence to semantic purity may be a case of premature optimisation.