Home >Web Front-end >HTML Tutorial >CSS naming convention, how to name it without making mistakes? _html/css_WEB-ITnose

CSS naming convention, how to name it without making mistakes? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:14:221176browse

Like this:

${}_{}2{}a{}字{}.b{}

How to name it without making mistakes?
There’s no need to glue the English dictionary up, that’s not what I want!


Reply to discussion (solution)

${}
_{}
2{}
Words{}
are all wrong, there is no such element


a{}
.b{}
Correct,
a represents the element8aa2918506a11e8a886e85949f1eb079< ;/a> style

.b{}
represents the name of the class

Commonly used naming methods
*{}
Element name {}
# id name {}
. class name {}

etc.

*{}
element name {}
#id name {}
. class name {}

http://hi.baidu.com/gjf05/item/62a12af405214d09d99e7247
If you search online, there will be many articles with this kind of information. In fact, the most important naming rule is to follow your page Related to the layout function, if you don’t know English, you can use a dictionary to translate ~

http://www.cnblogs.com/hlake/archive/2009/06/03/1495189.html
There are many on the website ~ Hehe~

#id{}
#id .class{}
#id .class div{}

Guaranteed not to mess up

Follow The naming rules for variables are similar

General css naming rules http://www.jqueryba.com/10.html

You must have a good naming rule, otherwise it is easy to conflict

Basically, as long as it doesn’t conflict with the name of the HTML element, it will be fine

Statement:
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