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
- All XHTMLCodeLowercase
- Attribute values must be enclosed in double quotation marks ("") and must have values.
- Each tag must have a start and end, and a correct level.
- An empty element must have an ending tag or add "/" after the starting tag "/"
- The representation and structure are completely separated, and the Code does not contain any representation elements, such as style, Font, bgcolor, and border.
- The definition from
- Adds a unique structure tag ID to each table and form.
- Add comments to important blocks, such:
- Add the alt tag to the image
- All labels must be reasonably nested.
- The root element must have an element before it is declared to use that DTD.
- The root element must have the xmlns attribute to specify the namespace of http://www.w3.org/5o/xhtml.
CSS style sheet specifications:
- 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)
- Comments for each block in the CSS style sheet
- Use naming rules in English whenever possible
- Do not add hyphens or underscores
- 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 |