When it comes to writing HTML in less standard environments, such as a phonegap app where strict syntax and semantics are not crucial, I have developed a unique approach that works for me.
I aim to keep my HTML code short and concise by using the following structure:
<i x y z="0"><b a b c></b></i>
This is then styled using CSS like so:
[x]{something}
[y]{something}
[z="0"]{...}
...
Instead of using traditional classes, which I find too complex for my preferences.
The advantages of this method for me include:
- Efficiency - saves time typing out code
- Works well with JavaScript for toggling attributes and making styles dependent on values
- Potential faster processing by machines due to shorter HTML code, but unsure about CSS performance compared to classes. Any insights on this are welcome!
- Haven't encountered any instances where this approach has failed
I am interested to know if there are any technical or performance-related reasons why this method may not be optimal, excluding concerns about code readability.