Home  >  Article  >  Web Front-end  >  What are the techniques for CSS abbreviation? Summary of five css tips

What are the techniques for CSS abbreviation? Summary of five css tips

云罗郡主
云罗郡主Original
2018-10-20 13:46:252277browse

When many people are learning CSS, they want to know what skills there are in CSS. In fact, mastering CSS style skills is also helpful to write CSS yourself. So what are the skills in CSS abbreviation? Let’s summarize five css tips below.

What are the techniques for CSS abbreviation? Summary of five css tips

1: The size of the css box. The css box mainly has two attributes, namely margin and padding. The two usages are the same. We all know that the box is three-dimensional. , and there are four directions, each direction has a border, then we take margin as an example, the code is as follows:

margin-top:2px;
margin-right:3px;
margin-bottom:3px;
margin-left:2px;

If you feel that the above is too complicated and not simple enough, you can also write margin like this: 2px 3px 3px 2px; syntax margin: top right bottom left; the two expression methods are also the same.

2: The properties of the border are as follows:

border-width:1px;
border-style:solid;
border-color:#000;

We can also change to another code:

border:1px solid #000;
语法 border:width style color;

3: How to write color

Color in css The representation method is hexadecimal. If the first two codes are the same, they can be abbreviated to half.

Four: When many students are learning CSS, they always like to write a semicolon when they finish writing the last attribute. In fact, the last semicolon does not need to be written.

5: We can use fonts to represent fonts, but first we need to define the abbreviated font, using two values: font-size and font-family respectively.

The above is what are the techniques for CSS abbreviation? All five css tips are introduced. If you want to know more about CSS video tutorial, please pay attention to php Chinese website.


The above is the detailed content of What are the techniques for CSS abbreviation? Summary of five css tips. For more information, please follow other related articles on the PHP Chinese website!

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