Common naming conventions for CSS class, ID, and CSS file names(i) Common CSS naming conventionsHead: HeaderContent: Content/containerTail: FooterNavigation: NavSidebar: SidebarColumn:
Sales: Salessales Contact Us: contactus Information release: Information Back home: Homepage order: Order E-commerce: e-business Copyright: Copy Right Links: Hot link Industry news: Tradenews Industry trends: Trends ZIP Code: Postalcodezipcode News: Newstrends Company name: CompanyName Sales Hotline: SALESHOT_ Line Contact: ContactPerson Construction: Inconstruction Certificate: Certificate Address: Add/add Tel: tel/tel Fax: fax/ Fax Product Name: ProductName Product Description: Description Pr
Product Sales: Salessales Contact Us: contactus Information release: Information Back home: Homepage order: Order E-commerce: e-business Copyright: Copy Right Links: Hot link Industry news: Tradenews Industry trends: Trends ZIP Code: Postalcodezipcode News: Newstrends Company name: CompanyName Sales Hotline: SALESHOT_ Line Contact: ContactPerson Construction: Inconstruction Certificate: Certificate Address: Add/add Tel: tel/tel Fax: fax/ Fax Product Name: ProductName Product Description: Descri
-block__element {}.sub-block--modifier {}
Benefits of 1.2 BEM nomenclature
The key to Bem is that you can get more descriptions and clearer structures, from whose names you can know the meaning of a tag. Then, by looking at the class attribute in the HTML code, you can know the association between the elements.
Example of a general naming method:
This kind of writing can understand the meaning of each e
standard usage in Web page making Div+css naming rules that can improve the effectiveness of optimization especially when teamwork can provide collaborative production efficiency, specific DIV CSS Naming conventions css
and should be combined with more concise and semantic English words
Naming note abbreviations, but not blindly abbreviated, see Common CSS naming conventions
Not allowed to be named by serial numbers 1, 2, 3, etc.
Avoid class and ID names
ID is used to ident
This article is to learn the CSS before, in order to standardize the name of CSS, looking for a note on the Internet.Feel good, so share out to let everyone see.Original Portal: http://www.divcss5.com/jiqiao/j4.shtml
standard usage in Web page making Div+css naming rules that can improve the effectiveness of opti
documents are expressed in a modular format. The approximate format is as follows:‘-------------------------------------------' Table name: Tbuser_info' Founding man: Uam_richard' Date: 2004-12-17' Version: 1.0' Description: Save user profile' Specific content:' UserId int, automatic incremental user code' UserName char (12) User name‘ ......‘--------------------------------------------Naming conventions
This article mainly and everyone to share the CSS naming specification can save Debug time related knowledge, interested friends to see together, hope to help everyone. Debug CSS is a time-consuming operation and can save a lot of debug time if you have a good naming convention.
Comment: Debug
. Use CSS Sprite technology to centralize small background images or icons to reduce page HTTP requests, but note that you must draw a reference line in the corresponding sprite PSD source map and save it to the IMG directory. Annotation Specification 1. HTML Comment: Note format 2. CSS Comments: note Format/* Here is the comment */;3. JavaScript comments, single-line comments using '//Here is a single-line
I. Description of naming rules:-TOP1), all the names are preferably lowercase2), the value of the attribute must be enclosed in double quotation marks (""), and must have values such as class= "DIVCSS5", id= "DIVCSS5"3), each label must have the beginning and the end, and must have the correct level, the layout has the regularity neatly4), empty element to have the end of the tag or after the beginning of t
want to use the extension method, then you can combine selectors to set the common style.
The premise of using this method is: the same type, function and appearance are similar, written in the same piece of code area for easy maintenance.
12345678910
/* 两个元件共性的样式 */.u-tip1,.u-tip2{}.u-tip1 .itm,.u-tip2 .itm{}/* 在分别是两个元件各自的样式 *//* tip1 */.u-tip1{}.u-tip1 .itm{}/* tip2 */.u-tip2{}.u-tip2 .itm{}
Prevent contaminatio
dependencies, that is, you do not want to use the extension method, then you can combine selectors to set the common style.
The premise of using this method is: the same type, function and appearance are similar, written in the same piece of code area for easy maintenance.
/* Two elements common style */ .u-tip1,.u-tip2 {}.u-tip1. ITM,. U-tip2. itm {}/* in the respective style of each of the two components Span style= "color: #008000;" >*/ /* tip1 */ .u-tip1 {}.u-tip1. IT
style for a separate home page
Head.css: Head style, multiple page head design style is used simultaneously.
Base.css: Common style.
STYLE.CSS: The style file used by the standalone page.
GLOBAL.CSS: Page style basics, global common styles, pages must contain.
LAYOUT.CSS: Layout, layout style, common types of use, generally used in the home page and product class pages
MODULE.CSS: Modules, for product
I. Description of naming rules1), all the names are preferably lowercase2), the value of the attribute must be enclosed in double quotation marks (""), and must have values such as class= "DIVCSS5", id= "DIVCSS5"3), each label must have the beginning and the end, and must have the correct level, the layout has the regularity neatly4), empty element to have the end of the tag or after the beginning of the ta
css| Specification | Web page | style sheet
Recently collaborated with a programmer project. Make my head is big ~ Blame my CSS name can not understand ~ to follow his. As a result, I opened his page, and looked, the first from the beginning is Contentcommon, the following are all content****. I explained my reasons, after half a while, seems to be accepted, but suddenly came to a: "Do not use the H tag!" a
Opera Chrome Safari in post-optimization, recommended test order: firefox– >ie7–>ie8–>ie6–>opera–>chrome–>safari, it is recommended to install Firebug and IE Tab plus plug-ins. Other Specifications 1. The development process strictly according to the Division of labor to complete the page, in order to improve the CSS reuse rate, avoid duplication of development; 2. Reduce the sink code and write code that everyone can read. Simplicity is a virtue.
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.