Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of external CSS File reference method in CSS programming

Shulou Source: shulou.com Published: 2022-06-03 11:46:52 10月23日 Update

CSS programming external CSS file reference method example analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

CSS external references use external CSS files, general browsers have a cache function, so users do not have to download this CSS file every time.

External references are efficient and save broadband compared to internal and inline references.

External references are recommended by W 3 C.

External reference CSS is the best way to introduce CSS (can minimize the amount of code, the performance is the most uniform, but also recommended by standard web design). Inline reference (used directly in HTML tags) is a quick way (except for cascading, I will introduce cascading in advanced tutorials), but it is not conducive to future uniform modification and consistent performance, so it is not recommended.

Use link tags to reference CSS

Example

Use @ import to reference CSS

Example

@ import url (http://www.dreamdu.com/style.css);

Relative path and absolute path

You can use relative or absolute paths when loading files

Absolute path: the full path of the file, the real path of the file or directory on the home page on the hard disk

Http://www.dreamdu.com/html/default.html is the absolute path, / html/default.html is also the absolute path, and C:winntsystem.sys is also the absolute path

Relative path: relative to the path where we view the document

.. / default.html or default.html or.. /.. / default.html are relative paths

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Path file example method label help recommendation unification method analysis programming minimum clear advanced consistent consistent no code content function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Redmi vpn Microsoft Apple