My personal JavaScript and CSS naming rules

Source: Internet
Author: User

1. Basic Object

Array, arr

Boolean, bool

Data, date

Number, num

String, STR

Regexp, Reg

Functions, no suffix

Event, event

Object, OBJ

Function parameters: arguments, ARG

Try to indicate what type of suffix is available, one is the reference of the button, and the suffix is BTN

2. Comment out its call stack when declaring an object or function. 3. When declaring a function, comment (1) function (2) function parameter type and function ---------------- CSS Part 1. Comment on the webpage layout module.
/*---GLOBAL---*/  /*--Structure--*/  /*--Typographic--*/  /*--Forms--*/  /*--Tables--*//*---HEADER---*//*---NAV---*/  /*--Primary--*/         /*--Secondary--*/    /*---CONTENT---*/  /*---SIDEBAR---*/  /*---FOOTER---*/
2. At what time and who did what.
/*----TITLE: Main screen styles | AUTHOR: EPL | UPDATED: 03/23/10 by EPL----*/
3. Style resetting
/*---RESET---*/ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {      margin: 0;      padding: 0;      border: 0;      outline: 0;      font-weight: inherit;      font-style: inherit;      font-size: 100%;      font-family: inherit;      vertical-align: baseline; }

Li {list-style: none;}/* remove small black spots inherent in li */
IMG {border: none;}/* removes the border of the image, mainly compatible with browsers below IE8 */
A {text-Decoration: none ;}
A: hover {text-Decoration: underline ;}
/* Clear floating */
. Clear2: After {content: '.'; display: block; clear: Both; Height: 0; visibility: hidden ;}
Html body Div. clear3,
Html body span. clear3
{
Background: none;
Border: 0;
Clear: both;
Display: block;
Float: none;
Font-size: 0;
Margin: 0;
Padding: 0;
Overflow: hidden;
Visibility: hidden;
Width: 0;
Height: 0;
} 4. Attribute grouping write box model attributes, positioning attributes, text and font attributes

Related Article

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.