www.webdeveloper.com
Results 1 to 5 of 5

Thread: Non-resizable div

Hybrid View

  1. #1
    Join Date
    Jan 2003
    Location
    UK
    Posts
    331

    Non-resizable div

    I have a div in which I display images. If the image is bigger than the div size, then the div resizes itself - is there any way to turn this around so that if the image is bigger than the div, then the image resizes itself.
    Thanks,

    IxxI
    0101100101100101011100110010110000100000011101110110010100100000011000110110000101101110001000000110 0001011011000110110000100000011101110111001001101001011101000110010100100000011010010110111000100000 01100010011010010110111001100001011100100111100100100001

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    This works in IE 5.5:
    Code:
    <div style="width: 200; height: 200">
    <img src="lilguy2.gif" width=100% height=100%>
    </div>

  3. #3
    Join Date
    Jan 2003
    Location
    UK
    Posts
    331
    Thanks for the reply gil, but is there a way to make so that if the image is smaller it does not resize itself - you see the div shows not just one but many pictures, and I want it so that if the image is small enough to fit in the div, then fine, but if it is too big then it makes itself smaller, does that make sense?
    Thanks again,

    IxxI
    0101100101100101011100110010110000100000011101110110010100100000011000110110000101101110001000000110 0001011011000110110000100000011101110111001001101001011101000110010100100000011010010110111000100000 01100010011010010110111001100001011100100111100100100001

  4. #4
    Join Date
    Nov 2002
    Posts
    4,473
    if the image is small enough to fit in the div, then fine, but if it is too big then it makes itself smaller
    You should realize that if you need to use an IF statement in your question, then the answer will probably require some SCRIPT to accomplish your desires. CSS alone wil not accomplish your idea.

    If you want a scripted answer, it woud be best to start a new post in the JS or DHTML forum.

  5. #5
    Join Date
    Jan 2003
    Location
    UK
    Posts
    331
    Thanks...
    0101100101100101011100110010110000100000011101110110010100100000011000110110000101101110001000000110 0001011011000110110000100000011101110111001001101001011101000110010100100000011010010110111000100000 01100010011010010110111001100001011100100111100100100001

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles