web development specification - html writing specifications

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

head area code specification

between the head area it refers to the content and the HTML code.
More meta tags, please visit this article

You must be added to the label

a) company Copyright Notes <-! The site is designed by EHM, Inc 07/2005 ->

b) web page display character set

Simplified Chinese:

<meta http-equiv=“Content-Type” content=“text/html; charset=gb2312”>

traditional Chinese:

<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>

English:

<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>

c) web page creator information <META name = "author" content = "wangjiabinweb @ 163⋅com">

d) - Description <META NAME = "DESCRIPTION" CONTENT = "This is some introduction">

e) the search key <META NAME = "keywords" CONTENT = "xxxx, xxxx, xxx, xxxxx, xxxx,">

css Specification f) page <LINK href = "... / css / style.css" rel = "stylesheet" type = "text / css">

g) page title <title> </ title>

You can choose to join the label

a) set of pages expiration time. Once the page expired, we must re-access to the server.

<META HTTP-EQUIV=“expires” CONTENT=“Wed, 26 Feb 1997 08:21:57 GMT”>

b) prohibit browser access to the contents of page cache from the local machine.

<META HTTP-EQUIV=“Pragma” CONTENT=“no-cache”>

c) to prevent someone calls your page in the framework.

<META HTTP-EQUIV=“Window-target” CONTENT="_top">

d) automatically jump.

<META HTTP-EQUIV = "Refresh" CONTENT = "5; URL Link"> 5 refers to the residence time of 5 seconds

e) Web search robot guidance. I used to tell the robot what pages need to search index, which does not require an index page.

<META NAME=“robots” CONTENT=“none”>

CONTENT parameters are all, none, index, noindex, follow, nofollow. The default is all.

f) favicon

g) all calls javascript try to take the external call.

<SCRIPT LANGUAGE=“JavaScript” SRC=“script/xxxxx.js”></SCRIPT>

h) attached <body> tag:

<Body> tag does not belong to the head area, where it emphasized, in order to ensure browser compatibility, you must set the page background <body bgcolor = "# FFFFFF">

Fonts

In setting the font style you should be using CSS style sheets styles for text size and line spacing. Banned <font size =?> Tag in the page.

Chinese in the page should be preferred to use Times New Roman. English and prefer to use digital verdana and arial two fonts. Commonly used Chinese 9pt and 11pt Times New Roman or 14.7px 12px and font size which is optimized, or when the bold italicized bold, generally used font size of 11pt and 14.7px suitable.

To maximize play browser automatically typesetting features, please complete section of text to try not to use human intervention <br> segment.

Text should be between a half-size space in different languages, with the exception of the head before and after the symbol to avoid avoid tail symbols, punctuation characters between use wide punctuation marks, letters and numbers in parentheses around half angle brackets should be used.

Please do not continuously appear on the page in more than one also minimize the use of full-width space (the English character set, em space will become garbled), the blank should try to use the text-indent, padding, margin, hspace, vspace and transparent gif pictures to achieve.

Recommended percentage spacing is defined common values ​​is two spaced line-height: 120% / 150%.

Typesetting, we often encounter the need to deal with first-line indent, do not use or full-width space to achieve the effect, the norm is to define p {text-indent: 2em;} in the style sheet and give each section plus < p> tag.

Note that, under normal circumstances, please do not omit </ p> end tag.

link

Web site link path in all relative path, usually links to files in the default path of a directory does not have to write the full name, as we do not like this: <a href="aboutus/index.htm"> but should be this: <a href="aboutus/">, all inside pages link to home page written <a href="/">.

In the browser, when we click on an empty link, it will automatically reset to the first end of the current page, thus affecting the normal user to read the contents, we use the code "javascript: void (null)" instead of the original "#" mark .

form

1px table style = "border-collapse: collapse "
examples are as follows:

<table border="1" cellspacing="0" width="32" height="32" style="border-collapse: collapse"
bordercolor="#000000" cellpadding="0"> 
<tr> 
<td></td>
</tr>
</table>

Set bright, dark border color
table with bright borders (bordercolorlight) and dark border (bordercolordark) two attributes can be set on a table style.
<table border = "1" width = "500" bordercolorlight = "# 000000" bordercolordark = "# FFFFFF">

When writing <table> nested within each other, in strict accordance with the specifications for the individual a <table> is, <table> <tr> aligned, <td> Indent two half-size space, <td> If there is nested tables, <table> also indented two half-size spaces, if <td> There are no nested tables, </ td> tag should end with <td> in the same line, do not wrap.

As we noted in the source code should not have code:
<TD> <IMG the src = "... / Images / sample.gif">
</ TD>
and should be such that:
<TD> <IMG the src = "... /images/sample.gif "> </ td>
this is because the browser thinks wrap the equivalent of a half-size space above wording does not inadvertently increase the standard equivalent to a half-size space, if indeed there is a need to increase the half-width space, it should be wrote:
<td> <img src = "... / ImagesRF Royalty Free / sample.gif"> </ td>
a whole page to try to avoid a large table with all the contents are nested within this large form of, because the browser in explaining the elements of the page, in a tabular display units one by one, if a page is nested within a large consequences in the form of, then it is likely to cause, when visitors type in the URL, he must first face blank for a long time, then all of the web content simultaneously. If you have to use <tbody> tag, so as to enable this large block table display.

download speed

Home Flash page size should be limited to 200K or less, as much as possible the use of vector graphics and animation Action to reduce the size. Home non-static page containing the image size should be limited to about 70K, replacing chunks of the same color as the background color pictures.

include

asp standard wording <-! # the include File = "INC. / index_top.asp" ->
JSP standard wording <% @ include file = "... / inc / index_top ... jsp"%>

Alt and Title

Alt and Title tags are suggestive language, please note the difference between them.

When we browse the Web, when the mouse hovers over the image or text link objects sometimes appear in the lower right corner of the mouse a message box. To target certain explanatory notes. In some cases, its role is very important.

alt pictures used to prompt. Title used to link text or plain text prompts.

Usage is as follows:

<p Title="给链接文字提示">文字</p>
<a href="#" Title="给链接文字提示">文字</a>
<img src="图片.gif" alt="给图片提示">

Cache

Pages are not cached

// HTM网页
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">
// ASP网页
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
clip_image005[1]Response.cachecontrol = "no-cache"

Browser Compatibility

When you create a site, you should understand that visitors may use a variety of Web browsers. In other design constraints known as the site is designed to have the maximum browser compatibility.

There are two dozen used Web browser, most have been released in several versions. Even if you only use for most Web users Netscape Navigator and Microsoft Internet Explorer, but you should clearly not the latest version of each of these two people are using the browser.

The more complex your site (in the layout, animation, multimedia content and interactive aspects), the less likely cross-browser compatible. For example, not all browsers can run JavaScript. Do not use special characters in plain text page may be able to display properly in any browser, but compared to the effective use of graphics, layout and interactive pages, such pages may be aesthetically much worse. Therefore, we should try to strike a balance between design and maximum browser compatibility design in the best results.

All attributes of HTML tags must be enclosed in single quotes or double quotes, that we should write <a href="url"> rather than <a href=url>.

Guess you like

Origin blog.csdn.net/weixin_44198965/article/details/94331729