+ Reply to Thread
Results 1 to 3 of 3

Thread: image fitting inside a div without stretching

  1. #1

    image fitting inside a div without stretching

    I need to fit an image inside a 300x300 div without stretching the image , i need a help with that please and thanks in advance

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    40
    If you want to use 300px as a minimum width , then here is the correct code
    Code:
    div {
        width:300px;
        height:300px;    
        overflow:hidden;
    }
    div img {
        min-width:100%;
    }

  3. #3
    thank you very much , that was helpful .

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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