Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    7
    Thanked 3 Times in 3 Posts

    Regarding setting of width and height for images

    If setting max values is used, like:
    Code:
    max-width: 100%
    max-height: 100%
    Is it still necessary to specify the image dimensions?
    say the image is 120x200px, does it still need
    Code:
    width: 120px
    height: 200px
    after the max is set?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Yes. It'll tell the browser about how much space need to be allocated for that image when rendering the page. It will avoid an unwanted jumping of subsequent elements after loading the image.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •