CSS url() 函数:浏览器支持
我在 引用 url() 的值真的有必要吗? 和 < a href="https://stackoverflow.com/questions/851724/css-background-image-what-is-the- Correct-usage">CSS 背景图像 - 正确的用法是什么? IE 5 不支持 url() 函数内的引号。
而且 PPK 的 CSS 页面根本没有提到 url() 函数: http://www.quirksmode.org/css/contents.html
所以我会想知道浏览器对该功能的支持情况如何。哪些浏览器可以识别该值,哪些浏览器需要哪些引号、空格等等。
我意识到过去五年发布的所有内容可能都支持所有语法。我正在考虑的是较旧的浏览器。
I have seen in the comments of Is quoting the value of url() really necessary? and CSS background-image - What is the correct usage? that Mac IE 5 does not support quotation marks inside the url() function.
Also PPK's CSS page does not mention the url() function at all:
http://www.quirksmode.org/css/contents.html
So I would like to know what browser support is like for this function. What browsers recognise the value, which ones require what quotation marks, whitespace, and so on.
I realise that everything released in the past five years probably support all syntaxes. It's the older browsers I am thinking of.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Mac IE5?严肃的? :) 我认为这个浏览器已经严重过时并且不再使用 :)
无论如何,根据 W3C,它是
body {background-image:url('paper.gif');}
它适用于所有(较旧的)浏览器。如果您需要对这种古老浏览器的支持,您正在为谁开发?
Mac IE5? Serious? :) I think this browser is seriously outdated and not being used anymore :)
Anyhow, according to W3C, it's
body {background-image:url('paper.gif');}
And it works for all (older) browsers. For who are you developing if you need support for this kind of ancient browsers?
对于任何浏览器类型,我从未遇到过任何背景图像问题。
当然,除非您将其作为没有内容的 div 且未指定元素的宽度和高度...
背景/背景图像或长手的示例用法
(以允许颜色和重复因素)
I have never ever had any issues with background-image for any browser type.
Unless of course you are putting it as a div with no content and not specifying the width and hight of the element...
example usage of background/background-image
or the long hand (to allow for color and repeating factors