Table of Contents
Previous words
Directory naming
Picture naming
File naming
Home Web Front-end HTML Tutorial Detailed introduction to html naming conventions

Detailed introduction to html naming conventions

Jul 26, 2017 am 11:17 AM
name specification

Previous words

Due to historical reasons and personal habits, the DOM structure and naming are not uniform, resulting in low efficiency when different members maintain the same page, and extremely high iteration and maintenance costs. Therefore, it is very necessary to use unified naming conventions. This article will introduce the naming convention in detail

Directory naming

1. Project folder: projectname

2. Style folder: css

3. Script folder: js

4. Style image folder: img

Picture naming

It is recommended to name pictures in the following order Naming:

 (m_) Picture function category (required) + picture module name (optional) + picture precision (optional)

 m_ indicates whether it is public, optional

[Picture function category]

icon: module type solidified icon

logo: LOGO type

spr: a combined collection of various elements on a single page

btn: button

bg: tileable or large background

pic: picture representing the current content or business

[Picture module name]

Goodslist: Product list

Goodsinfo: Product information

Userportrait: User avatar

[Picture accuracy]

General clear: @1x

Retina: @2x | @3x

//公共模块:
m_btn_goodlist@2x.png
m_btn_goodlist.png

//非公共模块:
wx_btn_goodlist@2x.png
wx_btn_goodlist.png
btn_goodlist.png
Copy after login

File naming

Make sure the file name always starts with a letter and not a number, and the letter Always lowercase, connected by underscores and without other punctuation marks, such as

<!-- HTML -->
connect.html
connect_list.html
connect_detail.html
<!-- SASS -->
connect.scss
connect_list.scss
connect_detail.scss
Copy after login

The above is the detailed content of Detailed introduction to html naming conventions. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Considerations for parameter order in C++ function naming Considerations for parameter order in C++ function naming Apr 24, 2024 pm 04:21 PM

In C++ function naming, it is crucial to consider parameter order to improve readability, reduce errors, and facilitate refactoring. Common parameter order conventions include: action-object, object-action, semantic meaning, and standard library compliance. The optimal order depends on the purpose of the function, parameter types, potential confusion, and language conventions.

Variable naming conventions required in Python learning Variable naming conventions required in Python learning Jan 20, 2024 am 09:03 AM

Variable naming conventions you need to know when learning Python An important aspect when learning the Python programming language is learning how to name and use variables correctly. Variables are identifiers used to store and represent data. Good variable naming conventions not only improve the readability of your code, but also reduce the possibility of errors. This article will introduce some commonly used variable naming conventions and give corresponding code examples. Use Meaningful Names Variable names should have a clear meaning and be able to describe the data stored in the variable. Using meaningful names allows it to

How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? Sep 05, 2023 pm 02:46 PM

How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? Introduction: When writing high-quality PHP code, it is very important to follow certain coding standards. Through code specifications, the readability, maintainability and scalability of the code can be improved. For the PHP language, there is a widely adopted code specification, namely PSR (PHPStandardsRecommendations). This article will introduce how to read the source code of the latest PHP code specification

What is the standard for API interface? What is the standard for API interface? Feb 23, 2024 pm 08:15 PM

API (Application Programming Interface) interface specification refers to a series of guidelines and specifications that define and specify API interfaces in software development. The purpose of the API interface specification is to ensure interoperability and consistency between different software components. This article will introduce several important aspects of API interface specifications. Interface naming convention The name of an API interface should be clear, concise, and consistent, and can accurately express its function and purpose. Naming conventions should follow industry practices and internal conventions of the development team, and avoid using vague and confusing terms. this

PyCharm formatting shortcut key analysis: how to quickly unify code style PyCharm formatting shortcut key analysis: how to quickly unify code style Jan 27, 2024 am 10:38 AM

Quickly standardize code style: The readability and consistency of PyCharm formatted shortcut key parsing code is very important for programmers. Under the premise of following certain coding style specifications, writing clean code can make the project easier to maintain and understand. As a powerful integrated development environment, PyCharm provides shortcut keys to help us quickly format code. This article will introduce several commonly used shortcut keys in PyCharm, as well as their specific usage and effects. 1. Code automatic indentation (Ctrl

How to solve the problem of irregular use of indented spaces in Python code? How to solve the problem of irregular use of indented spaces in Python code? Jun 24, 2023 pm 09:03 PM

Python is a very popular programming language. It is favored by more and more people because of its simplicity, ease of understanding, and ease of learning. In Python, indentation and code format are very important. If used irregularly, it will greatly affect the readability and maintainability of the code. This article aims to introduce several methods to solve the problem of irregular indentation spaces in Python code. Using automated tools In Python programming, it is very important to adhere to coding standards. Each indentation in the code should use the same number of spaces. If you manually modify line by line

What mistakes should be avoided in golang function naming? What mistakes should be avoided in golang function naming? Apr 22, 2024 pm 09:18 PM

Go function naming errors and countermeasures: avoid empty names and use descriptive names. Avoid lengthy names and use abbreviations or concise terms. Use lowercase letters to name functions for consistency. Avoid using underscores to keep your code clear. Make sure the name is consistent with the function and accurately reflects the function's functionality.

Step-by-step guide for creating folders on Realme mobile phone Step-by-step guide for creating folders on Realme mobile phone Mar 23, 2024 pm 03:51 PM

Step-by-Step Guide to Creating Folders on Realme Mobile Phones In our daily lives, we use our phones to store a variety of files, including photos, videos, documents, and more. However, as time goes by, the number of files on your phone may increase, causing insufficient memory on your phone or making it difficult to manage files. In order to better organize files and improve the efficiency of mobile phone use, the establishment of mobile phone folders has become particularly important. Realme Mobile is a popular smartphone brand with a powerful system and diverse features. Creating folders on Realme phones can help users better organize files

See all articles