Home  >  Article  >  Web Front-end  >  A link tag refers to multiple external styles. Are there any benefits to writing this way? _html/css_WEB-ITnose

A link tag refers to multiple external styles. Are there any benefits to writing this way? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:19:021626browse

stylesheet

d28422c07cfd8687301b9e362a2ef0e6

Reply to the discussion (solution)

It should be that js parses the parameters passed by the link tag to get the final imported style

Link does not have the function of importing multiple styles at one time. However, you can use the @import statement in the imported style sheet to import multiple other styles

The href of this link is not the original meaning. The href in the code you posted should be a file in the request backend (should be in mvc format). In this request, there are parameters

f=g.css,base.css,module/tips.css,tips-c.css,module/window.css,head.css,footer.css,main.css,pub.css&v=1.002

and version number. Obviously, the function of this request
http://t5.zbjimg.com/min/?b=v&f=g.css,base.css,module/tips.css,tips-c.css,module/window.css,head.css,footer.css,main.css,pub.css&v=1.002
is Return a whole piece of css code (it contains the code of all css files in the parameter). In fact, js files can also do this (return all necessary css or js files through one request). The purpose of this is of course to reduce the number of requests. , shorten the response time

Merge several css files into one css
window.css, head.css, footer.css, main.css, pub.css
From the naming point of view It can be seen

This can reduce the number of requests and improve access speed

Statement:
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