Can I use this (custom elements, custom attributes) on (for examples) IE 9 with this CSS? Is this valid? What are the negatives?
I want to have more readable code... without divs.
<row center>
<column number="6">A</column>
</row>
row {
background: #444;
display: flex;
&[center] {
justify-content: center;
}
column {
background: #222;
color: #fff;
&[number="6"] {
padding: 1rem;
width: 50%;
}
}
}
The case against custom elements has been made by other answers. As an alternative to this idea, HTML 5 has a number of new elements. These include <article>, <aside>, <figure>, <header>, <nav>, and <section>. Using these elements should make your page layout semantically meaningful, save you from puzzling over a sea of <div> and <span> elements, and be understood by modern browsers.
Making up your own markup language:
Content-Type: text/html HTTP header).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With