Medelwr Medelwr - 1 year ago 109
CSS Question

How to make image DOM element responsive

var img = document.createElement("img");
img.src = screenshots[i].content;
img.height = '1000';
img.width = '1000';

I want the height and width to be auto or % but it doesn't seem to be working with it.

I also tried

img.className = 'screenshot';

.screenshot {
height = '100%';
width = '100%';

With everything except setting the height and width to pixels on the DOM nothing works

Answer Source

You can use something like that

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download