Home > Web Front-end > CSS Tutorial > There are two reference methods for CSS external style sheets. What are they?

There are two reference methods for CSS external style sheets. What are they?

青灯夜游
Release: 2023-01-03 09:24:22
Original
16069 people have browsed it

Method: 1. Reference through "@import" in the style tag, the syntax is "@import url(URL)"; 2. Reference through the link tag, the syntax "".

There are two reference methods for CSS external style sheets. What are they?

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

CSS External Style Sheet

If the CSS style is placed in a file outside the web page document, it is called an external style sheet. A CSS style sheet document represents a External style sheet.

In fact, the external style sheet is a text file with the extension .css. When you copy the CSS style code into a text file and save it as a .css file, it is an external style sheet.

How to introduce external style sheets:

HTML files refer to style sheets with the extension .css. There are two ways: link type and import type. .

1. Introduction through the @import directive

The @import directive is part of the CSS language. When using it, add this directive to a