【Front-end】#001 Coding specification_html/css_WEB-ITnose
HTML coding style:
Document type: HTML5 type
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
- Strictly use closing tags to avoid nesting errors
- Do not mix JS, CSS, and HTML (extract CSS and JS)
- img, object Tags should use alt attributes
- button, input and other form tags. Remember to add the title attribute
- to simplify statements that reference CSS and JS
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
6. Prioritize the use of button tags instead of
7. The html tag must set the title attribute
CSS development specifications
- Encoded character set: UTF-8 (no BOM), saved as CSS file
- Must be written in lowercase letters
- Use meaningful short words for naming (or team norms)
- Add a space after the colon
- The selector and each attribute occupy one line each (selectors and curly braces do not need to be on a new line)
- Indentation: Fixed use 2 / 4 spaces, do not use the tab key
- A blank line between the selector name and the selector name (a blank line between the two style selectors)
- Each style needs to end with a semicolon Separate
1 |
|
1 |
|
1 |
|
1 |
|
Writing order
css It should be written in the following order. The principle is positioning and layout first, details second
- display mode display
- positioning or floating mode position, float, clear
- Up, down, left and right positioning offsets left, top, right, bottom
- Height and width dimensions height, width
- Inner and outer padding margin, padding
- Border border
- Background
- Color color
- Font text font
- Text line-height, text-align
- Other miscellaneous
Z-index usage specifications
In principle, module css must comply with the following specifications when using absolute positioning, but it is not enforced. During the development process, use less absolute positioning layout and more use the layout manager to manage the layout.
- Map: The index range used is from 0-99, including tile maps, custom layers, legends, layer management, etc.
- Interface business Module: The used index ranges from 100-199, real-time water conditions list, etc.
- Footer: The used index range is from 700-799, including copyright, filing, Technical support, etc.
- Navigation: The index range used is from 800-899, including logo, system name, navigation bar, etc.
- Pop-up box: The index range used is from 900-999, including settings panel, prompt box, etc.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati
