Home > Web Front-end > CSS Tutorial > CSS attribute value specifications you must know

CSS attribute value specifications you must know

王林
Release: 2020-06-12 15:42:14
forward
2989 people have browsed it

CSS attribute value specifications you must know

1. If the value is 0, usually no unit is needed

For example:

.list{
    border: 1px solid 0px;
    margin: 0px;
}
Copy after login

is changed to:

.list{
    border: 1px solid 0;
    margin: 0;
}
Copy after login

But there is a special case, that is, the time unit related to time must include seconds. The following two are illegal:

transition-duration: 0;
transition: transform 0 linear;
Copy after login

2. Use sixteen for color value In base system, use less rgb

as follows:

color: rgb(80, 80, 80);
Copy after login

is changed to:

color: #505050;
Copy after login

Because using rgb is a function, it also needs to calculate the conversion. If it is with transparency, then use rgba.

If the six numbers of the color value are the same, then just write 3:

color: #ccc;
Copy after login

3. Pay attention to the difference between border none and 0

The following two have the same meaning:

border: 0;
border-width: 0;
Copy after login

And the following two have the same meaning:

border: none;
border-style: none;
Copy after login

So the border can be removed using 0 and none.

Although the packaging tool will handle it for us in the end, it is still important to maintain a good writing habit.

Recommended tutorial: css quick start

The above is the detailed content of CSS attribute value specifications you must know. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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