html+css naming rules
In 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 name, not only will let the team's partners do not understand, but also cause the label name confusion, this will make the code maintenance is very difficult, is very detrimental to management. So we should have a good naming convention when designing an entire website or a separate HTML page. In this article, we mainly explain the CSS naming conventions , which also includes the naming of HTML tags .
The name of the file must start with the English alphabet, usually named according to the classification of the content and the type of frame to be translated into English words to name, for example: Div id= "nav" (denoted as this div is a navigation bar), all the words should be in lowercase letters, names can use numbers, or underscores, for example: div= "Main_piclist" (for a list of pictures under Main content), div= "Nav_bg.jpg" (for the background of the navigation bar), and you can use an underscore to connect between names, for example: div= "Main-left" (represents the layout of the left content) all names should try to avoid the use of Chinese characters, with the fewest letters to achieve the most easily understood meaning, unless you understand, otherwise try not to abbreviate.
the naming of HTML tags/css standardized naming encyclopediapage structure naming
- Page: Represents the entire page for the outermost layer.
- Wrap: A outer package that wraps all the elements together for the outermost
- Wrapper: page perimeter controls overall layout width for outermost
- Container: A whole container for the outermost
- Head, Header: Header area, for head
- Nav: Navigation bar
- Content: Contents, the most important content area of a Web site, for the middle body of a Web page
- Main: Primary area of the site (representing the most important piece of space) for the central body content
- Column: Column
- Sidebar: Side bar
- Foot, footer: page footer, footers. Site some additional information to place the area, (or named copyright) for the bottom
navigation naming
- Nav, NavBar, navigation, Nav-wrapper: Navigation bar or navigation package, representing landscape navigation
- Topnav: Top Navigation
- MAINBAV: Main navigation
- Subnav: Sub-navigation
- Sidebar: Side navigation
- Leftsidebar or sidebar_a: left navigation
- Rightsidebar or sidebar_b: Right navigation
- Title: Caption
- Summary: Abstract/li>
- Menu: Menus. The area contains general links and menus
- Submenu: Sub-menu
- Drop: Drop down
- Dorpmenu: drop-down menu
- Links: Link Menu
feature naming
- Logo: Flag website logo
- banner: Banner, banner, top banner
- login: Login, (e.g. login form: form-login)
- loginbar: Login /li>
- regsiter: Register
- Tool, toolbar: Toolbar
- Search: Search
- searchbar: Search bar
- searchlnput: Search Input Box
- Shop: Ribbon, which represents the current
- icon: Small icons
- Label: Trademarks
- homepage: Home
- subpage: Level two page face page
- Hot: Top hotspots
- list: A list of articles, (for example, a news list: List-news)
- Scroll: Scrolling
- tab: Label
- Sitemap: Sitemap
- MSG or message: Prompt for
- current:
- joinus: Join
- Status: Status
- btn: Button, (for example, Search button can be written as: Btn-search)
- tips: Tips
- Note: Comments
- Guild: Guide
- arr, arrow: Mark Arrows
- service: Services
- Breadcrum B: (That is, the page location navigation hint)
- download: Download
- vote: Poll
- siteinfo: Website Information
- PARTNER: Partners
- Link, Friendlink: Links
- Copyrights: Copyright Information
- siteinfocredits: Reputation
- Siteinfolegal: Legal information
CSS style naming
- The alignment style is named: Left (content on the side), center (middle content), right (content on the side), and so on;
- Color English name: Red (red), green, yellow (yellow), or border_red (red border), etc.;
- color code naming: f00 (red), ff0 (yellow), F90 (orange), etc.;
- Text size naming: font12px (font 12 pixels), font16px (font 16 pixels), etc.;
- Page Line name: line_x (horizontal), line_y (vertical line) or line_red (red), Line_black (Black)
- Image icon Name: pic_1.jpg, pic_2.jpg or Ico_1.gif, ico_2.gif
- Page ad naming: ad_01, ad_02
- Background frame naming: NAV_BG (the position of the background picture representing the navigation bar), TOOL_BG (representing the background image position of the toolbar)
CSS style sheet naming
- INDEX.CSS: Create a 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 class pages, can also be used in conjunction with other styles.
- MASTER.CSS: The main style sheet
- COLUMNS.CSS: Column Style
- Themes.css: Body Style
- Forms.css: Form Style
- MEND.CSS: Patches, based on the above style of privatization patching.
HTML and CSS naming-words too literally