How to adjust image size according to screen resolution?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alladin8889
    New Member
    • Jul 2016
    • 1

    How to adjust image size according to screen resolution?

    Is there anyone who can help to understand that how to manage image size according to screen resolutions?

    Requirements :
    -> Image should not cut from any side.
    -> Image should Increase/Decrease in proportion.
    -> Image height must be equal to screen size.
    -> Need to avoid Vertical/Horizontal scroll into screen.

    We can not use as a background because we need to work on responsive as well.

    I have created Landing page HTML where on LHS there is company logo and social media icons & on RHS there is a Image of lady (PNG cutout). Rather put it into background have used as an image to achieve responsive design.
  • devcake
    New Member
    • Oct 2016
    • 4

    #2
    Hello,

    You can make responsive image if you set next css rules on your img:

    Code:
     .image {
      width: 100%;
      height: auto;
    }
    This will show the full image.

    Comment

    • Sherin
      New Member
      • Jan 2020
      • 77

      #3
      Hello!
      I hope solution is helpful for you.
      Code:
      .responsive {
        width: 100%;
        height: auto;
      }
      
      <img src="img.jpg" alt="image" class="responsive">

      Comment

      Working...