srcset

Is there a srcset equivalent for css background image

↘锁芯ラ 提交于 2019-11-28 15:14:35
问题 img with srcset attribute looks like a great way of doing responsive images. Is there an equivalent syntax that works in css background-image property? HTML <img src="small.jpg" srcset="medium.jpg 1000w, large.jpg 2000w" alt="yah"> CSS .mycontainer { background: url(?something goes here?); } 回答1: image-set is the equivalent CSS feature. We should add equivalent srcset functionality (defining resources according to their dimensions) to the spec. Currently it's only implemented in Safari,

Google Chrome version 40 srcset attribute problems

别说谁变了你拦得住时间么 提交于 2019-11-28 07:38:17
I'm seeing a lot of inconsistencies with srcset attribute on img tags (responsive images) in Chrome 40.0.2214.91 Before I updated to Chrome v40 (I was on ~39), srcset attribute worked fine and would swap the image upon browser resize. Now, sometimes, the smaller version of the image will display if I have the browser set to the desired width then refresh the page. Other times it will not work whatsoever. Testing jsbin: http://jsbin.com/hulaconake/1/edit?html,output Image tag I have: <img srcset="http://placehold.it/300x200 300w, http://placehold.it/500x400 500w"> I'm also testing this in

Is it possible to see which srcset image a browser is using with browser developer tools

空扰寡人 提交于 2019-11-27 20:26:09
问题 I've been trying to see which srcset image my browser is using via the browsers developer tools, but apart from using the network tab to see which image it fetches i can't tell. Using the network tab would usually be fine, but sometimes I've noticed that it will fetch 2 image versions at different sizes, this would happen if one break point is at 600 and another at 900 and the browser was currently at 750px wide. (Ive tried this both on Chrome & FireFox, and it seems chrome will pull down

Google Chrome version 40 srcset attribute problems

ⅰ亾dé卋堺 提交于 2019-11-27 01:53:54
问题 I'm seeing a lot of inconsistencies with srcset attribute on img tags (responsive images) in Chrome 40.0.2214.91 Before I updated to Chrome v40 (I was on ~39), srcset attribute worked fine and would swap the image upon browser resize. Now, sometimes, the smaller version of the image will display if I have the browser set to the desired width then refresh the page. Other times it will not work whatsoever. Testing jsbin: http://jsbin.com/hulaconake/1/edit?html,output Image tag I have: <img

responsive images srcset not working

谁说我不能喝 提交于 2019-11-26 08:17:14
问题 I\'ve been trying to implement the new srcset approach to responsive images, using the following HTML <img class=\"swapImages\" srcset=\"assets/images/content/large.jpg 1200w, assets/images/content/medium.jpg 800w, assets/images/content/small.jpg 400w\" sizes=\"100vw\" src=\"assets/images/content/small.jpg\" alt=\"responsive image\"> Im using chrome 40 and all I get is the largest image, resizing my browser, clearing the cache does nothing. I read somewhere I had to polyfill, so I used the