Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having an image (without container) not stretched

Tags:

html

css

I would like my image to be not stretched and no scroll bars. So when the browser window is reduced the image is still the same size (but overflow is hidden).

<img src="http://nybbledesigns.com/images/header.jpg"/>

JsFiddle: http://jsfiddle.net/6ppL9axc/

I found solutions with containers but I need a solution without.

Any idea?

like image 929
Bronzato Avatar asked Nov 10 '22 01:11

Bronzato


1 Answers

Give this a try:

img {
    position: fixed;
    overflow: auto;
}
<img src="http://nybbledesigns.com/images/header.jpg"/>
like image 109
SuperDJ Avatar answered Nov 14 '22 22:11

SuperDJ