I
I
issssrt2015-09-24 12:22:32
css
issssrt, 2015-09-24 12:22:32

How to stretch an image (Img tag) to the full width of the screen without changing the height?

Need to stretch the image in the img tag to the full width (centered) while maintaining its original height? Those. not the whole part is shown in width. but only the one that fits the screen size.
Those. same as when using background url() center no-repeat;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_darkway, 2015-09-24
@issssrt

set the parent to overflow: hidden;
And the picture is the right size in pixels.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question