HTML基本标签

来源:互联网 发布:苹果cms 整合 ck 解析 编辑:程序博客网 时间:2024/06/07 16:12

转载出自:http://www.w3cschool.cn/html/html-css-basic-tags.html


组标题与hgroup

hgroup元素允许您处理多个标头元素作为单个项目,而不会影响HTML文档的大纲。

以下代码使用hgroup元素。

<!DOCTYPE HTML><html><body>  <hgroup>    <h1>H1</h1>    <h2>H2</h2>  </hgroup>  <h2>Additional</h2>  <h3>More information</h3>    <h1>H1</h1>    <p>This is a test.</p>    <h2>H2</h2>    This is a test.    <h3>H3</h3></body></html>

pre - 预格式化内容

pre元素中,空格不会折叠,并保留格式。当内容的一部分的原始格式是重要的时,这可能是有用的。

当您使用代码元素时,pre元素可能特别有用。

在编程语言中的格式化,例如,通常是显着的。

<!DOCTYPE HTML><html><head></head><body>  <pre>    <code>            var  fruits = ["XML",  "HTML", "CSS", "Java"];            for (var i = 0; i < fruits.length; i++)   {                document.writeln("I like  "  + fruits[i]);            }        </code>  </pre></body></html>

HTML引用

blockquote元素表示从另一个来源引用的块内容。

这个元素类似于q元素,但通常适用于较大数量的引用内容。

可以使用cite属性以提供内容的原始源的URL。

以下代码使用blockquote元素。

<!DOCTYPE HTML><html><body>  <blockquote cite="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">  Cascading Style Sheets (CSS) is a style sheet language used for  describing the look and formatting of a document written in a markup language.  </blockquote></body></html>

q元素表示从另一个来源引用的内容。

q元素的样式约定是以使用引号将引用的文本括起来。

以下代码使用q元素。

<!DOCTYPE HTML><html><body>  <p>    <q cite="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">          The <dfn title="Cascading Style Sheets">CSS</dfn>          is a style sheet language used for describing the          look and formatting of a document written in a markup language.    </q>  </p></body></html>

例子

<!DOCTYPE html><html><head>    <title></title></head><body>    <!--hgroup 元素允许您处理多个标头元素作为单个项目,而不会影响HTML文档的大纲。-->    <hgroup>        <h1>Hi</h1>        <h3>Jack</h3>    </hgroup>    <!--pre  空格不会重叠-->    <pre>这是pre标                      签</pre>    <pre>    <code>            var  fruits = ["XML",  "HTML", "CSS", "Java"];            for (var i = 0; i < fruits.length; i++)   {                document.writeln("I like  "  + fruits[i]);            }        </code>  </pre>    <!--blockquote 元素表示从另一个来源引用的块内容,通常引用一大块内容。-->    <blockquote cite="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">        Cascading Style Sheets (CSS) is a style sheet language used for        describing the look and formatting of a document written in a markup language.    </blockquote>    <!--q 引用一段话,会用双引号包裹起来-->    <q cite="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">        The <dfn title="Cascading Style Sheets">CSS</dfn>        is a style sheet language used for describing the        look and formatting of a document written in a markup language.    </q></body></html>


0 0
原创粉丝点击