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

📄 notes.html

📁 学习HTML的书籍
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!-- $Id: notes.src,v 1.26 1998/07/08 09:48:21 lehors Exp $ -->
<head>
<title>Performance, Implementation, and Design Notes</title>
<LINK rel="prev" SRC="changes.html">
<LINK rel="next" SRC="orgs.html">

</head>
<body>
<div class="navbar">
<center><a href="changes.html">previous</a> &nbsp; <a href="orgs.html">next</a> &nbsp; <a href="../contents.html">contents</a> &nbsp; <a href="../index/elements.html">elements</a> &nbsp; <a href="../index/attribs.html">attributes</a>
</center><hr>
</div>

<H1 align="center">Performance, Implementation, and Design Notes<a name="h-13.2">&nbsp;</a></H1>
<div class="subtoc"><p><strong>Contents</strong>
<ol>
<li><a href="notes.html#h-13.2.1">Notes on helping search engines index your Web site</a>
<ol>
<li><a href="notes.html#h-13.2.1.1">Search robots</a>
</ol>
<li><a href="notes.html#h-13.2.2">Notes on tables</a>
<ol>
<li><a href="notes.html#h-13.2.2.1">Design rationale</a>
<li><a href="notes.html#h-13.2.2.2">Recommended Layout Algorithms</a>
</ol>
<li><a href="notes.html#h-13.2.3"> Notes on styles</a>
<ol>
<li><a href="notes.html#h-13.2.3.1">New media types</a>
</ol>
<li><a href="notes.html#h-13.2.4">Notes on forms</a>
<ol>
<li><a href="notes.html#h-13.2.4.1">Incremental display</a>
<li><a href="notes.html#h-13.2.4.2">Future projects</a>
</ol>
<li><a href="notes.html#h-13.2.5">Notes on scripting</a>
<ol>
<li><a href="notes.html#h-13.2.5.1">Reserved syntax for future script macros</a>
</ol>
</ol>
</div>
<p>The following notes are informative, not normative.

<h2><a name="recs">Notes on helping search engines index your Web site</a><a name="h-13.2.1">&nbsp;</a></h2>
<p>This section provides some simple suggestions that will
make your documents more accessible to search engines.

<dl>
<dt><strong>Define the document language</strong>
<dd>In the global context of the Web it
	  is important to know which human language a page was written
	  in. This is discussed in the section on <a
	    href="../struct/dirlang.html#language-info">language
	    information</a>.

<dt><strong>Specify language variants of this document</strong>
If you have prepared translations of this document into other
languages, you should use the <a href="../struct/links.html#edef-LINK"><samp class="einst">LINK</samp></a> element
to reference these. This allows an indexing engine to offer users
search results in the user's preferred language, regardless of how the
query was written. For instance, the following links offer French and
	  German alternatives to a search engine:

<pre class="example">
&lt;LINK rel="alternate" href="mydoc-fr.html"
         lang="fr" title="La vie souterrainne"&gt;
&lt;LINK rel="alternate" href="mydoc-de.html"
         lang="de" title="Das Leben im Untergrund"&gt;
</pre>

<dt><strong>Provide keywords and descriptions</strong>
<dd>Some indexing engines look for <a href="../struct/global.html#edef-META"><samp class="einst">META</samp></a>
elements that define a comma-separated list of keywords/phrases, or
that give a short description. Search engines may present these
keywords as the result of a search. The value of the <a href="../struct/global.html#adef-name-META"><samp
	    class="ainst-META">name</samp></a> attribute sought by a
	  search attribute is not defined by this
	  specification. Consider these examples,

<pre class="example">
 &lt;META name="keywords" content="vacation,Greece,sunshine"&gt;
 &lt;META name="description" content="Idylic European vacations"&gt;
</pre>

<dt><strong>Indicate the beginning of a collection</strong>
<dd>Collections of word processing documents or presentations are
frequently translated into collections of HTML documents.  It is
helpful for search results to reference the beginning of the
collection in addition to the page hit by the search. You may help
search engines by using the <a href="../struct/links.html#edef-LINK"><samp class="einst">LINK</samp></a> element
with <b>rel="begin"</b> along with a <a href="../struct/global.html#edef-TITLE"><samp class="einst">TITLE</samp></a>,
as in:

<pre class="example"> 
&lt;LINK rel="begin" 
         href="page1.html" 
         title="General Theory of Relativity"&gt;
</PRE>

<dt><strong>Provide robots with indexing instructions</strong>
<dd>People may be surprised to find that their site has been indexed by
an indexing robot and that the robot should not have been permitted to
visit a sensitive part of the site.  Many Web robots offer facilities
for Web site administrators and content providers to limit what the
robot does. This is achieved through two mechanisms: a "robots.txt"
file and the <a href="../struct/global.html#edef-META"><samp class="einst">META</samp></a> element in HTML
	  documents, described below.
</dl>

<h3>Search robots<a name="h-13.2.1.1">&nbsp;</a></h3>

<h4>The robots.txt file<a name="h-13.2.1.1.1">&nbsp;</a></h4> 
<p>When a Robot vists a Web site, say http://www.foobar.com/, it firsts
checks for http://www.foobar.com/robots.txt. If it can find this
document, it will analyze its contents to see if it is allowed to
retrieve the document. You can customize the robots.txt file to apply
only to specific robots, and to disallow access to specific
directories or files.

<p>Here is a sample robots.txt file that prevents all robots from
	visiting the entire site:


<pre>
        User-agent: *    # applies to all robots
        Disallow: /      # disallow indexing of all pages
</pre>

<p>The Robot will simply look for a "/robots.txt" URL on your site,
where a site is defined as a HTTP server running on a particular host
and port number. Here are some sample locations for <tt>robots.txt</tt>: 

<div class="example"><P>
<table align="center" border="0" 
       bgcolor="#F8F0F0" 
       cellpadding="10" cellspacing="0">
<tr bgcolor="#F0E0E0"><th>Site URL<th>URL for <tt>robots.txt</tt>
<tr><td>http://www.w3.org/
<td>http://www.w3.org/robots.txt
<tr><td>http://www.w3.org:80/
<td>http://www.w3.org:80/robots.txt
<tr><td>http://www.w3.org:1234/
<td>http://www.w3.org:1234/robots.txt
<tr><td>http://w3.org/
<td>http://w3.org/robots.txt
</table>
</div>


<p>There can only be a single "/robots.txt" on a site.  Specifically,
you should not put "robots.txt" files in user directories, because a
robot will never look at them. If you want your users to be able to
create their own "robots.txt", you will need to merge them all into a
single "/robots.txt". If you don't want to do this your users might
want to use the Robots META Tag instead.

<p>Some tips: URL's are case-sensitive, and "/robots.txt" string must
be all lower-case. Blank lines are not permitted.

<p>There must be exactly one "User-agent" field. The robot should be
liberal in interpreting this field. A case insensitive substring match
of the name without version information is recommended.

<p>If the value is "*", the record describes the default access policy
for any robot that has not matched any of the other records. It is not
allowed to have multiple such records in the "/robots.txt" file.

<p>The "Disallow" field specifies a partial URL that is not to be
visited.  This can be a full path, or a partial path; any URL that
starts with this value will not be retrieved. For example,

<pre>
    <b>Disallow: /help</b> disallows both /help.html and /help/index.html, whereas
    <b>Disallow: /help/</b> would disallow /help/index.html but allow /help.html. 
</pre>
      
<p>An empty value for "Disallow", indicates that all URLs can be
retrieved.  At least one "Disallow" field must be present in the
robots.txt file.

<h4>Robots and the META element<a name="h-13.2.1.1.2">&nbsp;</a></h4>

<p>The <a href="../struct/global.html#edef-META"><samp class="einst">META</samp></a> element allows HTML authors to
tell visiting robots whether a document may be indexed, or used
to harvest more links. No server administrator action is required.

<div class="example"><P>
In the following example a robot should neither index this
document, nor analyze it for links.
<pre>
&lt;META name="ROBOTS" content="NOINDEX, NOFOLLOW"&gt;
</pre>

<p>The list of terms in the content is <tt>ALL</tt>, <tt>INDEX</tt>, 
<tt>NOFOLLOW</tt>, <tt>NOINDEX</tt>. The name and the content attribute
values are case-insensitive.
</div>

<div class="note"><P>
<em>Note: In early 1998 only a few robots implement this,
but this is expected to change as more public attention is
given to controlling indexing robots.</em>
</div>


<h2><a name="notes-tables">Notes on tables<a name="h-13.2.2">&nbsp;</a></h2>
<h3>Design rationale<a name="h-13.2.2.1">&nbsp;</a></h3>

<p>The HTML table model has evolved from studies of existing SGML
tables models, the treatment of tables in common word processing
packages, and a wide range of tabular layout techniques in magazines,
books and other paper-based documents. The model was chosen to allow
simple tables to be expressed simply with extra complexity available
when needed. This makes it practical to create the markup for
HTML tables with everyday text editors and reduces the learning curve
for getting started. This feature has been very important to the
success of HTML to date.

<p>Increasingly, people are creating tables by converting from other
document formats or by creating them directly with WYSIWYG editors.
It is important that the HTML table model fit well with these
authoring tools. This affects how the cells that span multiple rows or
columns are represented, and how alignment and other presentation
properties are associated with groups of cells.


<h4>Dynamic reformatting<a name="h-13.2.2.1.1">&nbsp;</a></h4>
<p>A major consideration for the HTML table model is that the author
does not control how a user will size a table, what fonts he or she
will use, etc. This makes it risky to rely on column widths specified
in terms of absolute pixel units. Instead, tables
must be able to change sizes dynamically to match the current window
size and fonts. Authors can provide guidance as to the relative widths
of columns, but user agents should ensure that columns are wide
enough to render the width of the largest element of the cell's
content. If the author's specification must be overridden, 
relative widths of individual columns should not be
changed drastically.

<h4>Incremental display<a name="h-13.2.2.1.2">&nbsp;</a></h4>
<p>For large tables or slow network connections, incremental table
display is important to user satisfaction. User agents should be able
to begin displaying a table before all of the data has been received.
The default window width for most user agents shows about 80
characters, and the graphics for many HTML pages are designed with

⌨️ 快捷键说明

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