The importance of CSS naming conventions and team work
With the future trend from the current html4+css2.0 to the development of html5+css3.0 upgrade, now the CSS naming convention is very important, of course, the development of HTML 5+
One of the most common questions people ask me is what does it mean in CSS class names -- __ ? They came from Bem and Nicolas Gallagher ...Bem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. This ingenious naming method makes your
html+css naming rulesIn a more content HTML page, you need to design many different frameworks, and then classify these different frameworks and content, give the corresponding names, so that the structure of the Web page is clearer, but also to facilitate the work. Many novice friends in the design of an HTML file, may only be based on their own ideas to give some simple name, but if blindly disorderly nam
shorthand Oh!
4.16 Binary color code abbreviations
Some color code can be abbreviated, we try to abbreviate it, improve the user experience mainly.
5 hyphen CSS Selector naming specification
1). Long name or phrase you can use the middle horizontal line to name the selector.
2). It is not recommended to use the "_" Underline to name the CSS selector, why?
The
_tips selectors, which are not valid in IE6)Good to distinguish JavaScript variable name (JS variable name is "_")Don't feel free to use IDID in JS is unique, can not be used multiple times, and the use of class selector is reusable, and the priority of the ID priority and class, so the ID should be used on demand, and can not be abused.Add a status prefix to the selectorSometimes you can add a prefix to t
css| Specification | A normalized web developer can identify the divs and other formatted page elements by creating CSS classes and ID names and using those names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in terms of
css|web| Specification | standardization
Web developers can identify divs and other formatting page elements by creating CSS classes and ID names and using these names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in terms o
I. About annotations
Annotations in CSS are important when you create a XHTML+CSS Web site. When you create CSS styles, you should keep the habit of commenting on them. In general, I am accustomed to using the "/* Comment content * * * * *" format to write comments, because in the editplus and so on with a highlighted editor, the use of C language commonly used
This article is for learning notes, part of which is excerpted from Mr. Xiaofeng's "CSS Design Guide" book
CSS Rules
A CSS rule is actually a CSS instruction that first selects the HTML element and then sets the style of the selected element.
Here is a simple CSS rule tha
CSS specifications and css naming rules
AbbreviationThe abbreviation can reduce the CSS file size and increase readability and maintainability.But not all values must be abbreviated, because when an attribute is abbreviated, all items are always set, and sometimes we do not want to set some items in the value.
/* For e
designer. However, it's a good idea to add a comment after naming it for future document generation.
Iii. on the nature of inheritance
In CSS, you should make good use of inheritance. For example, in two nested div, the parent element defines the Background-color property as black, and if the child element's background is the same as black, there is no need to repeat the definition. Being good at using
CSS comments, naming, inheritance, style sorting, and other CSS skills I. Comments
Comments in CSS are very important when you create an xhtml + CSS website. When creating CSS Styles, you should keep comments on your own. In gene
css| Specification | A normalized web developer can identify the divs and other formatted page elements by creating CSS classes and ID names and using those names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in terms of
I. Comments
Comments in CSS are very important when you create an xhtml + CSS website. When creating CSS Styles, you should keep comments on your own. In general, I am used to writing comments in the format of "/* Comment content */", because in EditPlus and other highly highlighted editors, it is meaningless to use comments such as "/****************/" commonly
As a front-end rookie, into the company's first project is halfway through the outsourcing company took over the company's website, on the basis of someone else has written, and then the name of what, simply do not too painful.Currently, this site has been completed, but the background staff pointed out that the naming is not standard. Have the desire to explain one or two sentences, but also feel that the one months in the name of the toss, indeed le
general abbreviations to name, for the name of the hump or the name of the line, the author suggested two kinds of use, the Hump naming method used to distinguish between different words, underline used to denote the subordinate relationship, such as the main navigation bar, we can name, Mainnav represents this navigation, mainnav-current indicates that the navigation is in the focus state, such as the navigation of this site:The HTML code is as foll
Description of the naming rules:1), 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= "PCSS5", id= "PCSS5"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 tag
not recommended to use the "_" Underline to name the CSS selector, why?Press the SHIFT key less when typing;Browser compatibility issues (such as naming using _tips selectors, which are not valid in IE6)Good to distinguish JavaScript variable name (JS variable name is "_")Don't feel free to use IDID in JS is unique, can not be used multiple times, and the use of class
you can see, only one. class file is produced, the file name is the class name. Classmake a summary of the above 3 points:from the above 3 experiments, the resulting. class file is not related to the interface it implements, the inherited parent class, in which case it produces only one.
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.