Web front-end Development specification documentation

Source: Internet
Author: User

Web front-end Development specification documentation

Specification Purpose:

Make the development process more standardized.

General Specification:

    • The TAB key is replaced with two spaces (the TAB key windos is four spaces, and the TAB key is linux eight spaces).

    • CSSstyle attributes or JAVASCRIPT code after adding ";" Convenient compression Tool "segmentation".
    • The file content encoding is unified UTF-8 .

    • CSS, the JAVASCRIPT non-comment class in the text character must be converted to Unicode encoding to use, to avoid coding errors when garbled display.
File specification:

    • File name with English words, multiple words with the Hump name method.

    • Some browsers will include these words as ad blocker, file naming, ID, class, and all other names to avoid the following words.
    • `ad`、`ads`、`adv`、`banner`、`sponsor`、`gg`、`guangg`、`guanggao`等
HTML Writing specification:

  

文档类型声明Unification is the HTML5 declaration type, 编码 unified as UTF-8.

<meta charset= "UTF-8" >

 <HEAD>Add information in the.

<meta name= "Author" content= "[email protected]" >//author <meta name= "description" content= "Hello" >//page description < Meta name= "keywords" content= "a,b,c" >//keyword, "," Delimited <meta http-equiv= "expires" content= "Wed, Feb 1997 08:21:57 GMT ">//sets the expiration time of the page. Once the page expires, it must be re-accessed on the server <meta http-equiv= "Pragma" content= "No-cache" >//prohibit browser from accessing the contents of the page from the local machine's cache <meta http-equiv= " Window-target "content=" _top ">//is used to prevent others from calling your page in the frame <meta http-equiv=" Refresh "content=" 5; url=http://kahn1990.com/">//jump page, 5 refers to the time to stay 5 Seconds Web Search Robot wizard. Used to tell the search robot which pages need to be indexed, which pages do not need an index <meta name= "robots" content= "none" >//content parameters All,none,index,noindex,follow, Nofollow, default is All<link rel= "Shortcut icon" href= "Favicon.ico" >//favorites icon <meta http-equiv= "Cache-control" content = "No-cache, must-revalidate" >//page is not cached

 

In non-special cases CSS , the style file is chained to the head, and the JAVASCRIPT file is linked to the bottom of the page.

<! DOCTYPE html>

JAVASCRIPTThe library file must contain the library name and version number and whether it is a compressed version.

Jquery-1.8.3.min.js

Introduce JAVASCRIPT plug-ins, file name format for library names + . + plug-in names.

JQuery.cookie.js

 

Naming method:

Class--Nheadtitle--class follows Small hump nomenclature (little camel-case) ID-n_head_title-ID follows name +_name-n_head_t Itle--The Name property is named following the first letter capital +_<div class= "Nheadtitle" id= "N_head_title" name= "N_head_title" ></div>

CSS Writing specification:

  CSSWriting order

. header {/* Display property */Display    | | Visibility    list-style    position Top | | right | | bottom | | Left    z-index    c Lear    float/* Own Properties */    width max-width | | min-width    height max-height | | min-height    Overflow | | clip    Margin    padding    outline    border    background/* Text properties */    color    font    text-overflow    text-align    text-indent    line-height    white-space    vertical-align    cursor    Content    };

 When multiple browsers are compatible, write standard attributes at the bottom

-moz-border-radius:15px; /* Firefox */-webkit-border-radius:15px; /* Safari and Chrome */border-radius:15px; /* Opera 10.5+, and the use of IE-CSS3 's IE browser *//standard properties  use z-index the property as far as possible z-index value not more than 150 (except for universal groups), the content of the elements of z-index the page Cannot exceed 10 (except for modules such as the cue box but remain below 150) and do not allow direct use (999~9999) between large values.  

 

Reduce the use of properties that affect performance.

position:absolute;float:left;//such as these positioning or floating properties  reduce the CSS use of filter expressions and picture repeat in, especially in the body, rendering performance is very poor, if you need to use repeat, The width or height of the picture cannot be less than 8px. 
JavaScript Writing specification:

Code format

"()" before and after the space "=" need to be followed by a space "," followed by a space JSON object needs to format the object parameters if, while, for, the execution of the Do statement with "{}" enclosed

The "{}" format is as follows

if (a==1) {    //code};

The following types of objects are not recommended for new constructs

New Numbernew stringnew booleannew Object//with {} instead of new Array//with [] instead

Picture specification:

Name the app, and 小写英文 数字 _ combine it to make it easier for other members of the team to understand

Header_btn.gifheader_btn2.gif

page element class pictures are put into img folders, test with pictures placed in the img/testimg folder, PSD source map into the psdimg folder.

The image format is limited to,,, and gif png jpg so on. pngwhen you make a picture with a picture, the format of the image is required png-8 .

Annotation Specification:

JAVASCRIPT, CSS file annotations need to indicate the author, file version, creation/modification time, major version modification record, function description, file version, creation or modification time, function, author and other information.
/* 注释块 */

Development and testing tools conventions:

Test tool: Pre-development test only Firefox & IE8 & IE9 & Opera &chrome & Safari

 

Web front-end Development specification documentation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.