css查询字符串 [英] css query string
本文介绍了css查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将查询字符串传递到样式表中,如果是,可以由css处理它?</ p>
http://www.domain.com/css/somestyle.css?id= 102992992
我注意到当查看basecamps源时,样式表有一个查询字符串,但我不知道如何使用它。
感谢
解决方案
是的,您可以传递querystring - 不能使用它。
有两个原因:
- 正在动态生成css文件
- 对于版本控制,请确保浏览器始终获取最新版本(例如,id可以是上次修改的时间戳)
Is it possible to pass a query string into a style sheet and if so, can the css process it?
i.e. http://www.domain.com/css/somestyle.css?id=102992992
I noticed when viewing basecamps source that the style sheet has a query string, but I don't see how it can be used.
Thanks
解决方案
Yes you can pass a querystring - no a plain CSS file can't use it.
There are two reasons to do it:
- The css file is being dynamically generated
- For versioning, to make sure the browser always gets the latest version (the id could be the last-modified timestamp, for example)
这篇关于css查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文