For common bootstrap, swiper, slide, fullpage, and so on, why is the "-" hyphen used instead of the camper? After all, you can double-click the camper to select it, and select another character. For common bootstrap, swiper, slide, fullpage, and so on, why is the "-" hyphen used instead of the camper?
After all, you can double-click the camper to select it, and select another character.
Reply content:
For common bootstrap, swiper, slide, fullpage, and so on, why is the "-" hyphen used instead of the camper?
After all, you can double-click the camper to select it, and select another character.
Front-end Code rarely uses the camper name method. The most common method is the hyphen. html and css code are the same. js uses the hyphen to unify the front-end code style.
You are talking about the class name and id name of css...
This general rule is consistent with the original language...
Css is always used-
Connected, suchborder-color
,margin-top
And so on.
Html attributes are also used-
Because html attributes are case-insensitive, using the hump will cause a lot of inconvenience, such ,
Js has always been using hump, suchgetAttribute
,offsetHeight
...
Js uses underscores, for example, defining the connection of constants.const GLOBAL_LOADDING = ''
However, many variables in js are underlined now...
Clearer semantics, clear at a glance
You can double-click to select an underscore.
Taking clarity and discerning at a glance as the primary objective
The selected style is not important.
Because the class name convention is to use-hyphens, you can look at the sass syntax, the default is to use.
The underline is clearer. At first, I also had a camper. Later, the company asked for the underline. Now I want to see the camper again. I feel like XX, especially I cannot know the meaning of the identifier immediately.
The underline is like an English word, which is easy to recognize and understand (the underline is regarded as a space, and the hump is connected and mixed)
In addition, you can double-click the underline to select it.