Meta Tag Guidelines for HTML Pages and PDF filesOnline documentation has grown not only in quantity, but also in complexity. Sun alone has millions of pages available to our internal, external, and partner customers. Because of the sheer volume of content, using consistent HTML code and including meta tags (which contain information about the document) are more important than ever. All customers must be able to find the right document quickly and confidently. This document outlines the creation of HTML and meta tags all Sun documentation should contain. By updating your content with these simple tags, you will help ensure our customers - including internal employees and partners - find the document they need the first time.
HTML and Meta Tag Summary TableClick on a link in the table for additional information on each tag, including:
IntroductionMeta information is simply defined as "data about a document." Often, as in the case of HTML, this information is embedded within the document itself. In the case of PDF files, the meta data is embedded in the file's properties. Content owners should create meta tags, as documented below, and maintain them as part of the regular Web publishing process. The correct application of meta data is very important to a number of software applications, search engines being one. Search engines, whether they be enterprise or WWW engines, can be configured to use meta data as a means to index additional information about content and to display meta data in the search results. The most important tags for search include the HTML TITLE, ALT, and Anchor tags (link text descriptions), and the DESCRIPTION and DATE meta tags. Click here to view an example of a fully compliant HTML page. Display Characteristics of Meta TagsCertain meta data are viewable to the user:
SpammingSun adheres to a NO SPAMMING policy and will remove any content that has evidence of spamming in the page content or meta data. Spamming is excessive repetition of a word in a page, optimizing a page for a word which is unrelated to the contents of the site, using invisible or tiny text, etc.
TITLE TagThe Title is perhaps the most important meta tag. The content in the Title tag appears:
Note: The Editorial Best Practices
When to Use Use the TITLE tag:
TITLE Tag Format:
PDF Guidelines Add PDF files must have appropriate titles. When you create a PDF file, the document title is autogenerated from the PDF file name. For example, an autogenerated PDF title might look like this: c:\work\whitepaper.pdf or as Template01.pdf. To edit the title of a PDF document after it is created, use Adobe Acrobat Professional or a free tool, such as: A-PDF INFO Changer. For instructions on adding meta data during PDF file generation, refer to the PDF Guidelines.
DESCRIPTION TagThe DESCRIPTION tag summarizes the page content and should accurately describe the intent and value of the document. Note: The DESCRIPTION tag must be written in the same language as the document, that is, it must be localized. Editorial Best Practices
When to Use Use the DESCRIPTION tag:
Note: Make sure to use a Description tag for ALL documents or pages that begin with something other than text, such as pages and documents that begin with a Table, Picture, TOC, etc. DESCRIPTION Tag Format Use this format:
NOTE: If there is no DESCRIPTION tag and a particular search engine requires one, the engines will usually display the first 150 characters of the page content. If these characters are not simple text (ex., are control characters that format a table, figure numbers, picture names, a TOC) or contextually relevant (ex., license terms, author information, etc.) the description will be poor and will result in a negative user experience as well as reduced click throughs and a loss of effectiveness of the content. PDF Guidelines A description is required for all PDF files that are published to Sun's sites. When you create a PDF file, the file description (called the "subject" in a PDF) is empty. To add a description to a PDF document after it is generated, use Adobe Acrobat Professional to update the "subject" field, or a free tool such as: A-PDF INFO Changer. For instructions on adding meta data during PDF file generation, refer to the PDF Guidelines. The length of the description text should be kept at or under 150 characters.
DATE TagThe DATE tag can reflect either the creation date or revision date. Note: The DATE tag should not be localized. Do Not modify the numeric format of the Date tag. When to Use The date of a document is an important piece of metadata for both the search engine and the user. The search engine uses the date in its ranking algorithm, and users look to the date to see if the document is recently updated or too old to consider. Sun's search engine determines the date of a document in three ways; it uses the first one it finds, in this order:
The DATE metatag should be included in documents, only if the HTTP header date will be incorrect. Some example scenarios where a DATE metatag is warranted:
Manually adding a DATE metatag can introduce problems when the page is updated, but the publisher does not change the date. Each time a page with a DATE metatag is revised, the tag should be checked. Editorial Best Practices To determine what date to use in the tag, refer to the following guidelines:
DATE Tag Format Use the following format:
Note: The DATE tag should not be localized. PDF Guidelines A PDF file date is a property of the file that cannot be edited. Therefore, each time you edit a PDF document you will change the file date.
KEYWORD Meta TagsThe KEYWORD meta tag allows you to provide additional text for the search engine crawler to index along with the HTML body content. The KEYWORD meta tag can be used to specify additional key words or synonyms that describe the contents of a site. KEYWORD meta tags are used in the indexing process but will not display on the web page. Note: The Keyword tag must be written in the same language as the document, that is, it must be localized. Editorial Considerations Some rules around keywords include:
When to Use Keywords should be used judiciously--if you are unsure whether or not to use keywords, please do not use them. Contact your Web Publisher if you have any questions. KEYWORD Tag Format
DOCTYPE (HTML Version Information) TagA valid HTML document declares what version of HTML was used to create the document. The Doctype declaration names the document type definition (DTD) used for the document. Editorial Considerations None. When to Use Use the Doctype tag on every HTML page. Format For most purposes, the following document type declaration should be used in HTML pages:
Note: The doctype declaration, though it refers to "EN", does not declare the content language of the document. It only declares the content language of the DTD. For a further discussion of this topic refer to the W3C Recommendations.
HTML LANG (Language) TagThe language attribute is used by the browser to choose the correct font for a document. Editorial Considerations None. When to Use Use the HTML Lang tag on every HTML page. Format
The
where "ll" is the language code, and "CC" is the country code. Please use:
or
The shorter "ll" option uses the language code only: For a list a language options, see: http://www.i18nguy.com/unicode/language-identifiers.html.
CONTENT-TYPE Tag
The CONTENT-TYPE declaration tells the client application what type of content is being served. In addition, it specifies the character encoding of the content. It should be the first thing declared in the Note: If the Content-Type tag is not placed before the Title tag, there is the likelihood that titles that contain non-ASCII characters will not be interpreted correctly. Editorial Considerations None. When to Use Use the Content-Type tag on every HTML page. Content-Type Tag Format Declare within the head <head> tag using this format:
Set the charset attribute to the correct encoding of the document. This could be UTF-8, ISO-8859-1 or many others. For example,
Note 1: Changing the charset attribute on its own does not change the character encoding of the document.
CONTENT-LANGUAGE Tag
The content language of the document needs to be declared a second time. This is declared as meta information within the Editorial Considerations None. When to Use Use the CONTENT-LANGUAGE tag on every HTML page. Format Use this format:
Where "ll" is the language code and "CC" is the country code. For example, the correct content language options for French Canadian is: content="fr-CA"> For a list a language options, see: http://www.i18nguy.com/unicode/language-identifiers.html.
Anchor Text (for HREF Links) TagFrom a user experience perspective, a descriptive link is, in most circumstances, more appropriate than providing the user with an actual http://... reference. Editorial Considerations
When to Use Every link should have a text description. Anchor Description Format Adapt the sample below to conform to the your needs and the style conventions of your Web site: Page source: ...For additional information about JavaScript, refer to the mozilla.org page titled, "<a class="linkgrey" href="http://www.mozilla.org/js/">What is JavaScript?</a>"... User display: For additional information about JavaScript, refer to the mozilla.org page titled, "What is JavaScript?"
ALT Tag for ImagesALT tags allow text to be associated with images. ALT tags are used by screen readers and other tools that enable accessibility for disabled users. In addition, they display in most browsers during mouseover. ALT tags provide compliance of Section 508 Federal guidelines for accessibility. For additional information, refer to: http://www.sun.com/access/508/index.html Note: The ALT tag must be written in the same language as the document, that is, it must be localized. Editorial Considerations
When to Use Every image used to identify programmatic features, such as controls, status indicators, and user actionable elements require an ALT tag description. Images used for page formatting do not require ALT tag descriptions. ALT Tag Format Adapt the sample below to conform to the your needs and the style conventions of your Web site: Page source:
Mouseover display: Welcome to java.com. Brought to you by Sun Microsystems.
Example Of Fully Compliant HTML Page
Additional InformationMeta data specifications are available from the W3C: HTML 4.01 Specification Details, Chapter 7: The Global Structire of an HTML Document: http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.4 How the Sun Microsystems Search Engine WorksWhen the Sun's search engine parses a document, it looks at the meta tag values and body text. For most content areas, Sun's search engine weights meta tags relative to the body text of the document. These weightings are used when determining the ranking of the document for query terms.
To optimize your pages for the search engine, ensure that you are following the Title tag best practices (link to that section in the doc) along with guidelines for Description and Keyword tags. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||