Naming rules in Div + CSS

Source: Internet
Author: User

The last time I showed the DIV effect to someone else, I wrote a CSS style but couldn't render it. Finally, I accidentally found that when I wrote a CSS style, I named a classStart with a numberThis problem also occurred when I learned the style sheet last year. I finally solved it. I should declare that the name in CSS should not start with a number, preferably a letter.

The following are:CSS naming rules

 

 

XHTML-CSS writing advice
    1. All XHTMLCodeLowercase
    2. Attribute values must be enclosed in double quotation marks ("") and must have values.
    3. Each tag must have a start and end, and a correct level.
    4. An empty element must have an ending tag or add "/" after the starting tag "/"
    5. The representation and structure are completely separated, and the Code does not contain any representation elements, such as style, Font, bgcolor, and border.
    6. The definition from
    7. Adds a unique structure tag ID to each table and form.
    8. Add comments to important blocks, such:
    9. Add the alt tag to the image
    10. All labels must be reasonably nested.
    11. The root element must have an element before it is declared to use that DTD.
    12. The root element must have the xmlns attribute to specify the namespace of http://www.w3.org/5o/xhtml.

 

CSS style sheet specifications:
    1. The ID and class names are based on the English words or combinations of the Forum, and the first word is lowercase, and the first letter of the second word is uppercase, such as newrelease (latest product/New + release)
    2. Comments for each block in the CSS style sheet
    3. Use naming rules in English whenever possible
    4. Do not add hyphens or underscores
    5. Try not to be abbreviated, except words that can be understood without looking at them.

 

CSS naming rules

During this time, due to work needs, I made some research on CSS naming, mainly to make the documents and other specifications easier to understand and understand.

Div CSS name Description
Website public
Container Div # Container Container
Header or banner Div # Header Page header
Main or global navigation Div # Mainnav Main navigation
Menu # Menu Menu
Sub menu # Submenu Sub-menu
Left or Right Side Columns # Sidebarb, # sidebarb Left or right sidebar
Main Div # Main Page subject
Content Div # Content Content
The main content area # Contentmain Main Content Area
Footer Div # Footer Footer
Tag # Tag Tag
Message # MSG # message Prompt information
Tips # Tips Tips
Vote # Vote Vote
Friend Link # Friendlink Friendship
Title # Title Title
Summary # Summary Summary
Sub-Navigation list # Subnav Level 2 navigation
Search Input # Searchinput Search input box
Search output # Searchoutput The search output is similar to the search result.
Search # Search Search
Search results # Searchresults Search results
Copyright information # Copyright Copyright information
Brand # Branding Trademark
Branding-logo # Brandinglogo Logo
Site Information # Siteinfo Website Information
Copyright information etc. # Siteinfolegal Legal disclaimer
Designer or other credits # Siteinfocredits Credit
Join us # Joinus Join us
Partnership Opportunities # Partner Partner
Services # Service Service
Regsiter # Regsiter Register
Status # Status Status
Electronic trade problems
Products . Products Product
Products Prices . Productsprices Product Price
Products Description . Productsdescription Product Description
Products Review . Productsreview Product reviews
Editor's review . Editorreview Edit comment
New Release . Newsrelease Latest Product
Publisher . Publisher Manufacturer
Screen Shot . Screenshot Thumbnail
FAQ . FAQs FAQs
Keyword . Keyword Keywords
Blog . Blog Blog
Forum . Forum Forum

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.