是否可以弥补HTML标签? [英] Is it possible to make up HTML Tags?

查看:107
本文介绍了是否可以弥补HTML标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阻止我执行此操作的原因:

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?

根据我的理解,浏览器会根据选择器规则找到并匹配css样式,只要指定所有必需的规则即可

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?

推荐答案

这是可能的,但不会在屏幕上看到一个小红色框。工作在所有浏览器开箱即用,虽然他们将有一定程度的支持。如果你真的想创建自己的HTML标签子集,你应该考虑为它创建自己的DTD。

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.

DTD是一个文档类型定义,基本上是一个文件浏览器会读取您的特定HTML标记语言子集中可用的标记。

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.

本文介绍如何创建自己的DTD,但它不推荐,因为它不是有效的HTML。

This article describes how to create your own DTD, however it's not recommended to do so, because it won't be valid HTML.

这篇关于是否可以弥补HTML标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆