Simple Custom elements with HTML and CSS

1 week ago 18
ARTICLE AD BOX

Current information online regarding the creation of custom HTML elements provides information on such things as registering a custom element with the DOM using Javascript. I have noted that in the context of a page, it's possible to use a style to create a custom element ("zot") thusly:

<style> zot { display: inline; color: blue; font-size: 2em; yada: foo; etc.... } </style>

Subsequently, within the body of my document, I can use something such as:

<zot>Some text or other information here</zot>

... and it works as expected in the presentation of the HTML on a browser.

What's lost in the use of this ultra-simple technique, other than the ability to reference the element zot in a Javascript context, and is this generally safe to use as a simple styling shortcut?

Read Entire Article