Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make up HTML Tags? [duplicate]

Tags:

html

css

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?

like image 607
Abhishek Avatar asked Jun 01 '11 06:06

Abhishek


Video Answer


2 Answers

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.

like image 112
ChrisR Avatar answered Sep 27 '22 20:09

ChrisR


It should work, however, this will cause your HTML to not validate unless you also create a custom DTD.

like image 29
snowBlind Avatar answered Sep 27 '22 20:09

snowBlind