Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以通过CSS的属性加载背景图像?_Css_Css Content - Fatal编程技术网

是否可以通过CSS的属性加载背景图像?

是否可以通过CSS的属性加载背景图像?,css,css-content,Css,Css Content,我想知道,如果属性得到一个特定的类,我是否可以使用CSS来加载背景。为了演示,它应该加载到悬停 HTML <div id="testdiv" title="http://www.thesearchagents.com/wp-content/uploads/2013/11/Google-Search.jpg">hover me...</div> 不幸的是,鼠标悬停时没有背景图像显示 (如何)实现这一点?理论上,是的: background-image: attr(ti

我想知道,如果属性得到一个特定的类,我是否可以使用CSS来加载背景。为了演示,它应该加载到
悬停

HTML

<div id="testdiv" title="http://www.thesearchagents.com/wp-content/uploads/2013/11/Google-Search.jpg">hover me...</div>


不幸的是,鼠标悬停时没有背景图像显示

(如何)实现这一点?理论上,是的:

background-image: attr(title url);
url
是一个关键字,告诉浏览器将title属性解释为url值

不幸的是,这种用法充其量只是实验性的,在任何主流浏览器中都不受支持


所以现在,答案是否定的,你不能这么做。太遗憾了。

谢谢你。非常有趣的语法。
background-image: attr(title url);