There are three linking methods in CSS in html. Do you know which ones they are? The three linking methods of CSS text are inline definition, linking into internal CSS, and linking into external CSS. Let’s take a look at them below.
There are three ways to link css text: inline definition, linking into internal css, and linking into external css
1.The code is:
2.The code is:
3.The code is:
code 3's style.css is in the same folder as your html file.
The code is:
#p1{ border:2px; color:red;} #p2{ border:2px; color:blue;} .p3{ border:2px; color:red;}
In the css,
id must be preceded by a
Add a .
in front of #class. Supplement:
Thank you for reading. Have you learned it?
This article is reproduced from: https://blog.csdn.net/weixin_43670802/article/details/94174581
Recommended tutorial: "HTML Tutorial"
The above is the detailed content of Learn the three link methods of CSS in Html in one minute. For more information, please follow other related articles on the PHP Chinese website!