将<dl>标记放在我的<p>标记中?</p> </dl>

时间:2013-02-05 10:23:44

标签: xhtml tags

我只是在学习xhtml,我们的老师希望在段落标记之间引用这句话:

"Definition lists are lists of terms and their definitions. They are a little different than ordered and unordered lists in that the items are listed in pairs. The dl and dl surround the list. The name of the term appears between dt and dt, and the definition is between dd and dd."

但是当我把标签放入时,我的输出看起来就像下面那样。我怎么能把&lt;&gt;周围没有把它解释为定义标签???

"Definition lists are lists of terms and their definitions. They are a little different than ordered and unordered lists in that the items are listed in pairs. The <dl> and </dl> surround the list. The name of the term appears between<dt> and </dt>, and the definition is between <dd> and </dd>."

2 个答案:

答案 0 :(得分:1)

如您所知,字符<>&在(X)HTML中具有特殊含义。您可以(并且应该)分别编写&lt;&gt;&amp;来逃避它们。

另请参阅this article,“何时使用转义”部分。

答案 1 :(得分:1)

试试这个:

“定义列表是术语及其定义的列表。它们与有序和无序列表略有不同,因为项目是成对列出的。&lt; dl&gt;和&lt; dl&gt;围绕列表。该术语的名称出现在&lt; dt&gt;和&lt; dt&gt;之间,定义介于&lt; dd&gt;和&lt; dd&gt;之间。“