"Html/css" HTML/CSS naming conventions

Source: Internet
Author: User

No matter what you do, the rules are always the most important. No rules inadequate surrounding area, with the rules, we can have rules to follow, there is the ability to depend on, people can communicate with each other normally.

Everyone has their own naming habits, but the code is the need to communicate, when some naming habits can only be understood, and even after they do not understand, it became an obstacle in communication. Therefore, it is important to have a canonical naming convention. There are a lot of naming rules, you picking, here are some of the customary naming conventions in Html/css, the right to record:

1, all the names are best lowercase

2, 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 typesetting has the regularity neatly

4, empty elements to have the end of the tag or the beginning of the tag after adding "/"

5, the performance and structure completely separate, the code does not involve any expression elements, such as style, font, bgColor, border, etc.

6,

7. Add a unique, structural tag ID to each table and form

8. Add alt tag to picture

9. Use the English naming principle as much as possible

10, try not to abbreviate, unless a look on the words understand

  CSS Naming conventions:

Header: Header content: Content/containe

Tail: Footer Navigation: Nav

Sidebar: Sidebar column: Column

Page perimeter control overall layout width: wrapper: Left Right Center

Login: Loginbar Logo: Logo

Ad: Banner page body: main

Hotspot: Hot NEWS: News

Download: Download sub-navigation: Subnav

Menus: Menu submenu: Submenu

Searching: Search Links: Friendlink

Footer: Footer Copyrights: Copyright

Scrolling: Scroll Contents: Content

Tab: Tab Article list: List

Tip: Msg Tips: Tips

Column title: Title join: Joinus

Guide: Guild Services: Service

Registration: Regsiter Status: State

Vote: Vote partner: Partner

Naming conventions for HTML tag IDs:

(1) Page structure

Container: Container Header: Header

Content: Content/container page body: main

Tail: Footer Navigation: Nav

Sidebar: Sidebar column: Column

Page perimeter control overall layout width: wrapper: Left Right Center

(2) Navigation

Navigation: Nav main: Mainbav

Sub-navigation: Subnav Top navigation: Topnav

Side navigation: Sidebar left navigation: Leftsidebar

Right navigation: Rightsidebar Menus: Menu

Submenu: submenu caption: Title

Abstract: Summary

(3) function

Logo: Logo ad: Banner

Login: Login Login: Loginbar

Registration: Regsiter Search:

Functional area: Shop title: Title

Join: Joinus State: status

Button: BTN Scroll: Scroll

Tab: Tab Article list: List

Hint message: Msg present: Current

Tips: Tips Icons: Icon

Note: Note Guide: Guild

Services: Service hotspot: Hot

Press: News Download: Download

Vote: Vote partner: Partner

Links: Link Copyrights: Copyright

  Style file naming:

Main: Master.css

Layout page: Layout.css

column: Columns.css

Text: Font.css

Plot style: Print.css

Theme: Themes.css

"Html/css" HTML/CSS naming conventions

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.