Learn the three link methods of CSS in Html in one minute

烟雨青岚
Release: 2020-07-06 13:17:38
forward
3602 people have browsed it

Learn the three link methods of CSS in Html in one minute

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:

  内联定义 

内联定义

内联定义

内联定义

Copy after login

2.The code is:

  链入内部css  

链入内部css

链入内部css

Copy after login

3.The code is:

  链入外部css  

链入外部css

链入外部css

链入外部css

Copy after login

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;}
Copy after login

In the css,
id must be preceded by a

Add a .

in front of #class. Supplement:

  外联式css样式03      

lalala

Copy after login

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!

Related labels:
source:csdn.net
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!