This is an article for CSS newbies. It may be very familiar to many netizens, but for many newbies, learning CSS is a big difficulty, not because CSS is difficult to understand, but because of the English words in CSS. too much. In fact, the principle of CSS is very simple. For example, if we want to describe a person, we can write like this:
Example Source Code
[www.downcodes.com] Zhang Fei {
Height: 185 cm;
Weight: 105 kg;
Gender: male;
Personality: irritable;
Nationality: Han;
}
Through such a table, a person's basic situation can be described. Each row in the table describes a certain attribute of a person and the attribute value of the attribute. The role of CSS is to set the presentation of each component of a web page. Therefore, if the above table is replaced by an attribute table describing a title on the web page, it can be imagined that it should look roughly like this:
Example Source Code
[www.downcodes.com] Level 2 title {
Font: Song Dynasty;
Size: 15 pixels;
Color: red;
Decoration: underline
}
Going one step further, if we write the above table in English:
Example Source Code
[www.downcodes.com] h2{
font-family: "宋体";
font-size:15px;
color: red;
text-decoration: underline;
}
Miraculously, this is the correct CSS code. It can be seen that the principle of CSS is actually very simple. For native English speakers, writing CSS code is almost as easy as using natural language.
For those of us whose native language is not English, it is naturally a little more difficult. Of course, there are actually only a few dozen English words used in CSS. Even if you don’t understand English at all, you only need to spend some time to understand the dozens of necessary words, as well as some words often used in CSS layout, such as content, container and other "idioms", and add continuous Practice, I believe learning will be much easier.
Here I have summarized a "CSS Chinese-English Dictionary" in pdf format. Readers can download it. There are 160 words in total. If you are really not good at English, you can spend a few days and memorize it once, or start learning it. If you encounter a word you don’t recognize, you can look up its meaning.