Home > Web Front-end > Front-end Q&A > How to use link to introduce css in html

How to use link to introduce css in html

藏色散人
Release: 2023-01-04 09:38:30
Original
16042 people have browsed it

htmlHow to use link to introduce css: first create an HTML example as a file; then use the syntax "<link href="img/divcss5.css" rel="stylesheet" type="text/css" />" Just introduce the specified css file.

How to use link to introduce css in html

The operating environment of this tutorial: Dell G3 computer, Windows 7 system, HTML5&&CSS3 version.

Recommended: "css Video Tutorial"

There are 4 ways to introduce CSS in HTML. Two of them are to add CSS code directly in the HTML file, and the other two are to introduce external CSS files. Below we will introduce some methods of using link tags to introduce CSS styles in HTML. The

link tag is usually placed in the head tag of a web page and is used to link external css files and link favorite icons (favicon.ico). The most common use of the tag is to link external Style sheets, external resources.

link introduces css examples:

<link href="img/divcss5.css" rel="stylesheet" type="text/css" />
Copy after login

Explanation of the content structure of the link tag when linking to external css styles

The href value is the external resource address, here is the address of css

rel defines the relationship between the current document and the linked document, here is the external css style sheet, that is, stylesheet

type specifies the MIME class of the linked document, here the value is text/css

The above is the detailed content of How to use link to introduce css in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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