SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Width of Div depending on image width

    Hi there,

    I have a div that I would like to automatically adjust the width of depending on the image width specified within the HTML

    Anyway of doing this is CSS ?

    Cheers

    James

  2. #2
    Carpe Diem = Fish of the Day fisherboy's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try setting a fixed width that is less than any image you are likely to include then:
    overflow: visible;

    This may well ruin the document flow though.

    Any chance of a link to see what you're trying to do?
    fisherboy
    Web Site Design

  3. #3
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks anyway - solved the problem myself. Just didn't specify the width of the div and it now works fine

    Cheers

    James


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
  •