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

WBOY
Release: 2016-06-24 12:14:22
Original
1138 people have browsed it

Like this:

${}_{}2{}a{}字{}.b{}
Copy after login

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 element< ;/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

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!