Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 858137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:30:09+00:00 2026-05-15T08:30:09+00:00

I have a div with an image in it, and the image is too

  • 0

I have a div with an image in it, and the image is too large for the div. I have solved the overflow problem with the obvious CSS overflow:hidden trick.

But, the problem is that when the div’s parent resizes (shrinks), the div holding the image won’t shrink because of the image in it.

Is there a way to have a resizable div with an image in it (almost like a background image) that overflows?

MY DIV STRUCTURE:

<div id="parent">
    <div id="image_holder">
        <!-- this image will inevitably be larger than its parent div -->
        <img src="too_big_for_div.jpg" /> 
    </div>
</div>

MY CSS:

#parent { width:100%;}
#image_holder { width:100%; overflow:hidden;}

The #image_holder div will not resize to a smaller dimension now. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:30:09+00:00Added an answer on May 15, 2026 at 8:30 am

    I ‘ve tested your code and it does resize the inner div. To actually observe it, try setting the border property of the image_holder, and also set the parent ‘s percentage width to a lower value like so:

    #image_holder { width:100%; overflow:hidden; border: 1px solid red;}
    #parent { width:70%;}
    

    If you resize the browser window and can observe the rightmost border, it means your DIV resizes normally. Perhaps there’s something else wrong.

    If you could provide more info, I’d be glad to help…

    P.S.: Tested in IE8, FF 3.6.3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DIV containing an image and a second DIV. The parent DIV
i have a div and and a looping move function that translates an image
I have a div that contains 3 fields You can see the image here
I have one div that should contain text and bellow it one image. I
I have problem with the background div, when I resize the window too much,
I have a <div /> that contains a image and a anchor. The anchor
So, I have a DIV full of four HTML buttons that use an image
I have an image div like this <div class=bgCover>&nbsp;</div> <div class=overlayBox style=position: fixed; background-image:
I have a div and an image inside it as a background: <div id=background>
i have many div's with the same background image and i want change this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.