⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 html_primary.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Basic HTML Tags</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>

<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>


<h1>Basic HTML Tags</h1>
<a href="html_elements.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_attributes.asp"><img border="0" src="../images/btn_next.gif" alt="Next" width="100" height="20" /></a>

<hr />
<p class="intro">The most important tags in HTML are tags that define
headings, paragraphs and line breaks.</p>
<p class="intro">The best way to learn HTML is to work with examples. We
have created a very nice HTML editor for you. With this editor, you can edit the
HTML source code if you like, and click on a test button to view the result.</p>
<hr />

<h2>Try it Yourself - Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_basic">A very simple HTML document</a><br />
This example is a very simple HTML document, with only a minimum of HTML tags.
It demonstrates how the text inside a body element is displayed in the
browser.&nbsp;</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_paragraphs1">Simple paragraphs</a><br />
This example demonstrates how the text inside paragraph elements is displayed
in the browser.
</p>

<p>(You can find more examples at the bottom of this page)</p>

<hr />

<h2>Headings</h2>

<p>Headings are defined with the &lt;h1&gt; to &lt;h6&gt; tags. &lt;h1&gt;
defines the largest heading. &lt;h6&gt; defines the smallest heading.</p>
<table width="100%" class="ex" cellspacing="0" border="1">
  <tbody>
    <tr>
      <td>
        <pre>&lt;h1&gt;This is a heading&lt;/h1&gt;
&lt;h2&gt;This is a heading&lt;/h2&gt;
&lt;h3&gt;This is a heading&lt;/h3&gt;
&lt;h4&gt;This is a heading&lt;/h4&gt;
&lt;h5&gt;This is a heading&lt;/h5&gt;
&lt;h6&gt;This is a heading&lt;/h6&gt;</pre>
      </td>
    </tr>
  </tbody>
</table>
<p>HTML automatically adds
an extra blank line before and after a heading.</p>
<hr />

<h2>Paragraphs</h2>

<p>Paragraphs are defined with the &lt;p&gt; tag.</p>
<table width="100%" class="ex" cellspacing="0" border="1">
  <tbody>
    <tr>
      <td>
        <pre>&lt;p&gt;This is a paragraph&lt;/p&gt;
&lt;p&gt;This is another paragraph&lt;/p&gt;</pre>
      </td>
    </tr>
  </tbody>
</table>
<p>HTML automatically adds
an extra blank line before and after a paragraph.</p>
<hr />

<h2>Don't Forget the Closing Tag</h2>

<p>You might have noticed that paragraphs can be written without end tags &lt;/p&gt;:</p>
<table width="100%" class="ex" cellspacing="0" border="1" id="table1">
  <tbody>
    <tr>
      <td>
        <pre>&lt;p&gt;This is a paragraph
&lt;p&gt;This is another paragraph</pre>
      </td>
    </tr>
  </tbody>
</table>
<p>The example above will work in most browsers, but don't rely on it. Future version of HTML will not allow you to
skip ANY end tags.</p>
<p>Closing all HTML elements with an end tag is a future-proof way of writing 
HTML. It also makes the code easier to understand (read and browse) when you 
mark both where an element starts and where it ends. </p>
<hr />

<h2>Line Breaks</h2>

<p>The &lt;br&gt; tag is used when you want to break a line, but don't want to start a new
paragraph. The &lt;br&gt; tag forces a line break wherever you place it.</p>
<table width="100%" class="ex" cellspacing="0" border="1">
  <tbody>
    <tr>
      <td>
        <pre>&lt;p&gt;This &lt;br&gt; is a para&lt;br&gt;graph with line breaks&lt;/p&gt;</pre>
      </td>
    </tr>
  </tbody>
</table>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_paragraphs">Try it 
yourself</a></p>
<p>The &lt;br&gt; tag is an empty tag. It has no end tag like &lt;/br&gt;, since a closing 
tag doesn't make any sense.</p>
<hr />

<h2>&lt;br&gt; or &lt;br /&gt;</h2>

<p>More and more often you will see the &lt;br&gt; tag written like this: &lt;br /&gt;</p>
<p>Because the &lt;br&gt; tag has no end tag (or closing tag), it breaks one of 
the rules for future HTML (the XML based XHTML), namely that all elements must 
be closed. </p>
<p>Writing it like &lt;br /&gt; is a future proof way of closing (or ending) the tag 
inside the opening tag, accepted by both HTML and XML.</p>
<hr />

<h2>Comments in HTML</h2>

<p>The comment tag is used to insert a comment in the HTML source code. A
comment will be ignored by the browser. You can use comments to explain your
code, which can help you when you edit the source code at a later date.</p>
<table width="100%" class="ex" cellspacing="0" border="1">
  <tbody>
    <tr>
      <td>
        <pre>&lt;!-- This is a comment --&gt;</pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Note that you need an exclamation point after the opening bracket, but not before the closing bracket.</p>
<hr />

<h2>Recap on HTML Elements</h2>
<ul>
	<li>Each HTML element has <b>an element name</b> (body, h1, p, br)</li>
	<li>The <b>start tag is the name</b> surrounded by angle brackets: &lt;h1&gt;</li>
	<li>The <b>end tag is a slash and the name</b> surrounded by angle brackets 
	&lt;/h1&gt;</li>
	<li><b>The element content</b> occurs between the start tag and the end tag</li>
	<li>Some HTML elements have no content</li>
	<li>Some HTML elements have no end tag</li>
</ul>
<hr />

<h2>Basic Notes - Useful Tips</h2>
<p>When you write HTML text, you can never be sure how the text is displayed in
another browser. Some people have large computer displays, some have small. The
text will be reformatted every time the user resizes his window. Never try to
format the text in your editor by adding empty lines and spaces to the text.</p>
<p>HTML will truncate the spaces in
your text. Any number of spaces count as one. Some extra information:
In HTML a new
line counts as one space.&nbsp;</p>
<p>Using empty paragraphs &lt;p&gt; to insert blank lines is a bad habit. Use
the &lt;br&gt; tag instead. (But don't use the &lt;br&gt; tag to create lists.
Wait until you have learned about HTML lists.)</p>
<p>HTML automatically adds
an extra blank line before and after some elements, like before and after a
paragraph, and before and after a heading.</p>
<p>We use a horizontal rule (the &lt;hr&gt; tag), to separate the sections in our tutorials.</p>
<hr />

<h2>More Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_paragraphs2">More paragraphs</a><br />
This example demonstrates some of the default behaviors of paragraph elements.
</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_paragraphs">Line breaks</a><br />
This example demonstrates the use of line breaks in an HTML
document.
</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_poem">Poem problems</a><br />
This example demonstrates some problems with HTML formatting.
</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_headers">Headings</a><br />
This example demonstrates the tags that display headings in an HTML document.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_hr">Horizontal rule</a><br />
This example demonstrates how to insert a horizontal rule.</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_comment">Hidden comments</a><br />
This example demonstrates how to insert a hidden comment in the HTML source
code.
</p>

<hr />

<h2>Basic HTML Tags</h2>
<p>If you lookup the basic HTML tags in the reference below, you will see that 
the reference contains additional information about tag attributes.</p>
<p>You will learn more about HTML tag attributes in the next chapter of this 
tutorial.</p>

<table class="ex" cellspacing="0" border="1" width="100%">
<tr>
<th align="left">Tag</th>
<th align="left">Description</th>
  </tr>
  <tr>
<td><a href="../tags/tag_html.asp">&lt;html&gt;</a></td>
<td>Defines an HTML document</td>
  </tr>
  <tr>
<td><a href="../tags/tag_body.asp">&lt;body&gt;</a></td>
<td> Defines the document's body</td>
  </tr>
  <tr>
<td><a href="../tags/tag_hn.asp">&lt;h1&gt; to &lt;h6&gt;</a></td>
<td> Defines header 1 to header 6</td>
  </tr>
  <tr>
<td><a href="../tags/tag_p.asp">&lt;p&gt;</a></td>
<td>Defines a paragraph</td>
  </tr>
  <tr>
<td><a href="../tags/tag_br.asp">&lt;br&gt;</a></td>
<td> Inserts a single line break</td>
  </tr>
  <tr>
<td><a href="../tags/tag_hr.asp">&lt;hr&gt;</a></td>
<td> Defines a horizontal rule</td>
  </tr>
  <tr>
<td><a href="../tags/tag_comment.asp">&lt;!--&gt;</a></td>
<td>Defines a comment</td>
  </tr>
</table>
<br />
<hr />
<a href="html_elements.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_attributes.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -