Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of external CSS File reference method in CSS programming

2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report