【发布时间】:2014-04-21 11:29:42
【问题描述】:
基本上我想命名一个基本上是 div 的自定义标签,但名称不同,以便您在查看 HTML 代码时可以看到它是什么。 JavaScript 底层将使用 circular-view 和 circular-objects 使其工作。到目前为止,我有这个,但页面上显示的都是]>。顺便说一句,JavaScript 代码还没有真正做任何事情。
<!DOCTYPE html
[
<!ELEMENT circular-view (circular-object*)>
<!ELEMENT circular-object EMPTY>
<!ATTLIST circular-object icon CDATA #REQUIRED>
<!ATTLIST circular-object title CDATA #REQUIRED>
]>
<!--
The custom element circular-view is to be used as a container
for the circular-objects inside
You must set the icon="link to image file"
and title="text" attributes of each circular-object
You can also set the id="" attribute of a circular-view
to give it a custom size, layout, etc
-->
<html>
<head>
<title>Example</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
<link rel="stylesheet" type="text/css" href="Framework/FrameworkStyles.css"/>
<script src="Framework/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="Framework/Animation.js"></script>
<script type="text/javascript" src="Framework/CircularSelection.js"></script>
<script type="text/javascript" src="Framework/CircularObject.js"></script>
<script type="text/javascript" src="indexScript.js"></script>
<!-- The page-specific JavaScript file should come last in the
list of scripts to avoid any declaration problems -->
</head>
<body onload="pageLoad()">
<!---->
<circular-view id="featuredView"><!--The container-->
<circular-object title="1" icon="Example Pizza.png"/><!--JS will add img and div tags as children to display the stuff-->
<circular-object title="2" icon="Example Pizza.png"/>
<circular-object title="3" icon="Example Pizza.png"/>
<circular-object title="4" icon="Example Pizza.png"/>
<circular-object title="5" icon="Example Pizza.png"/>
<circular-object title="6" icon="Example Pizza.png"/>
<circular-object title="7" icon="Example Pizza.png"/>
<circular-object title="8" icon="Example Pizza.png"/>
<circular-object title="9" icon="Example Pizza.png"/>
<circular-object title="10" icon="Example Pizza.png"/>
<circular-object title="11" icon="Example Pizza.png"/>
</circular-view>
<!---->
</body>
</html>
我是 DTD 的新手,实际上是几个小时前,所以我不确定我在做什么。
【问题讨论】:
-
这听起来像是一个 XY 问题。您这样做是为了了解 DTD 吗?因为可能有更简单的方法来做到这一点。