How to resize image according from screen resolution on html css


Tags: html,css,image,screen-resolution

Problem :

I want to change an image so that its size is according to the screen resolution, for example 1920x1080 to 1600x900, using HTML and CSS.

How can I do it?



Solution :

HTML :

<div class="img-div">
<img src="path-to-image">
</div>

CSS :

.img-div { height:100%; width:100%;}
img { max-width:100% }

    CSS Howto..

    CSS How to place a submit button on a new line?

    css code how to put the navigation in the middle

    How to Make a Picture rotate Continuously? [closed]

    How to make text appear under div without moving other items in list?

    How to change tooltip style in jQuery vmap?

    How do i resize an image based on its div width? [duplicate]

    How to get the CSS attributes from a control located by XPath using Selenium IDE

    How to add a simple card flip animation?

    How to have the nav and footer more than 1000px?

    How to position two blocks side by side with CSS

    How to style select crossbrowser [duplicate]

    How to get rid of CSS cascading in internal element widgets

    How to pause a CSS keyframe animation when it ends the first cycle?

    How implement google fonts when download the font in collection?

    How Does CSS Opacity Work When Adding Class?

    How can I increase space just above the footer line?

    How to fade background images (from CSS) in and out with jquery

    how to do drop down list

    Customizing ebay store HTML and CSS code (How to?)

    How to use CSS to center the buttons?

    How can I change my code from PHP to HTML?

    How to style CGI python with CSS?

    How is struts finding css files?

    How to make Visual Studio stop “compiling” .js and .css files

    How to apply a transition effect to some text when hovering over an icon?

    How to make half-square background in css

    In a framework using rewrite rules, how best to integrate CSS and JS?

    How to alternate background colour on DIV rows? (Jquery and/or CSS)

    CSS Image size, how to fill, not stretch?

    How to set alternating color to nested and sibling divs with certain class.