Home > Web Front-end > HTML Tutorial > I just learned css and I have a question_html/css_WEB-ITnose

I just learned css and I have a question_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:23:48
Original
1076 people have browsed it

I’m confused about the use of punctuation marks in css. I watched the css tutorial on w3school. Are there any regulations on the use of those "#" "," ";" these punctuation marks?
Don’t know when to add which punctuation marks


Reply to discussion (solution)

Every symbol has its meaning, don’t worry about not remembering this , write it often and you will naturally remember it all. Let me give you a small example.
#p {
text-align: center;
color: black;
font-family: arial;
}

.p {
text-align : center;
color: black;
font-family: arial;
}
Only braces, colons and semicolons are punctuation marks. The semicolon is the separator for multiple attributes. The colon is the value corresponding to the attribute. Others such as "#", "." all have certain meanings. The number #p indicates that the id is the tag of p; .p indicates that the class is the tag of p. etc. You can try to practice according to that first. If you accidentally make a mistake, the error message will basically be very detailed.
As time goes by, writing will naturally become smoother.

Of course, if it is ID in HTML, the corresponding css should use #. For example, in HTML it is id="test1", and the css corresponding is #test1{},
If the corresponding is class , then the css is., for example, in HTML class="test2", the corresponding css is .test2{}

The use of punctuation marks in css is very confusing. I watched the css tutorial on w3school, those "# " "," ";"Are there any regulations on the use of these punctuation marks?
Don’t know when to add which punctuation marks
Start from the beginning and read slowly, carefully and patiently over and over again
And understand by actually writing the code manually
You shouldn’t ask about basic knowledge

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