Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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/7/css/35.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
Html 我可以在css中使用srcset属性来编辑分辨率吗?_Html_Css_Srcset - Fatal编程技术网

Html 我可以在css中使用srcset属性来编辑分辨率吗?

Html 我可以在css中使用srcset属性来编辑分辨率吗?,html,css,srcset,Html,Css,Srcset,我想知道我是否可以使用css中的srcset属性(例如)将所有图像设置为2x,它通常是这样工作的 <img src="image.jpg" srcset="image.jpg 1x, higher-resolution-image.jpg 2x" > 我想知道是否有一种方法可以在css中使用它,使所有图像以2x显示 提前感谢:D你会发现这篇文章很有用: 它提到使用图像集: background:-webkit图像集(url('path/to/image')1x,url('pa

我想知道我是否可以使用css中的srcset属性(例如)将所有图像设置为2x,它通常是这样工作的

<img src="image.jpg" srcset="image.jpg 1x, higher-resolution-image.jpg 2x" >

我想知道是否有一种方法可以在css中使用它,使所有图像以2x显示
提前感谢:D

你会发现这篇文章很有用:

它提到使用图像集:


background:-webkit图像集(url('path/to/image')1x,url('path/to/high-res-image')2x)

您应该使用一个标志来指出一个重复的问题,而不是链接到该问题并在此处复制答案。这一点很好,但我只是认为,因为该问题是针对“所有图像”的,所以可能需要另一个解决方案,可能默认情况下会影响所有图像。@ShastriH:甚至没有使用“共享”链接;-)。顺便说一句,
-webkit图像集
可以放在任何需要图像的地方,而不仅仅是
背景
,因此它应该覆盖所有(webkit)基础。可能的