What's stopping me from doing this:
<head>
<style type="text/css">
red{
display:block;
background:red;
height:20px;
width:20px;
}
</style>
</head>
<body>
<red></red>
Will this work? What's going to stop it?
From what I understand, the browser will find the and match the css styles based on the selector rules, and so long as you specify ALL the required rules (I'm sure there're more), what's stopping me from seeing a small red box on screen?
It's possible but won't work across all browser out of the box, though they will have some degree of support for it. If you really want to create your own subset of HTML tags you should look into creating your own DTD for it.
A DTD is a document type definition which is basically a file the browsers reads to see what tags are available in your specific subset of the html markup language.
This article describes how to create your own DTD, however it's not recommended to do so, because it won't be valid HTML.
It should work, however, this will cause your HTML to not validate unless you also create a custom DTD.
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