background-image - CSS 背景图像的 url 可以使用哪些网络协议(protocol)?

标签 background-image network-protocols

我正在构建一个需要 str_replace() 的应用程序对于任何字符串 http:https:在背景图像的 URL 中。有谁知道背景图像的 URL 可能的任何其他协议(protocol)?例如,是否可能出现以下任何情况,或者是否有人在 CSS 背景图像 URL 中看到以下任何情况?

TCP
UDP
ICMP
POP
FTP
IMAP

举个例子,这对 CSS 可行吗?
#myDiv {    background-image: URL("ftps://mysite.com/pub/myimage.png");    }

感谢您的任何见解!

最佳答案

这显然是合法的语法,跟在 CSS standard 之后。由 W3C 提供。您可以在其中放置任何合法的 URI,但这取决于浏览器是否可以正常工作。

TCP、UDP 和 ICMP 是不同类型的协议(protocol),因此它们不会起作用,但 ftp、pop 和 imap 理论上可以工作。语法见这里:https://en.wikipedia.org/wiki/URI_scheme

您也可以将所有图片替换为 data URI s,基本上嵌入一切。

关于background-image - CSS 背景图像的 url 可以使用哪些网络协议(protocol)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31638751/

相关文章:

css - 在 body 背景图像上方显示带有渐变的日落效果

iphone - iPad 和 iPhone : full page background image shows cut off/screen shot link included

linux - 有关在 Linux 中自定义第 2 层实现的说明

python - Sulley 模糊测试框架中的位标志依赖性

html - 将背景图片移到顶部 [CSS]

html - 在 CSS 中为背景图像添加边距

css - 多个背景图片定位

networking - TCP 连接理论 : Minimum rate of sequence numbers

networking - 什么是 'TCP out-of-order' 和 'TCP port number reused' 问题?

network-programming - 基本 IRC 服务器协议(protocol)概述/教程