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 3397960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:35:30+00:00 2026-05-18T04:35:30+00:00

I have a relative positioned div with many absolute positioned img in it: <div

  • 0

I have a relative positioned div with many absolute positioned img in it:

<div class="container">
     <img />
     <img />
</div>

.container{
    position: relative;
    border: 4px solid #ccc;
}
.container img
{
    position: absolute;
}

What am I trying to achieve? I’m using a jquery image fader plugin to fade in and out images.

The images show up but the .container does not stretch to the height. How do I fix this?

  • 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-18T04:35:30+00:00Added an answer on May 18, 2026 at 4:35 am

    Absolutely positioned elements are taken out of normal flow and are not used to compute the height of other elements.

    You have to set the height explicitly. Ideally by knowing the size of the images in advance and setting it in your stylesheet, or alternatively by measuring it with JavaScript.

    Another option would be to replace absolute positioning with something else (what that something else might be would depend on the effect you are trying to achieve).

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

Sidebar

Related Questions

I have following HTML+CSS markup: <div id=protofade style=position: relative;> <div style=position: absolute;><img src=slide-01.jpg></div> <div
I have an absolute positioned div in a relative positioned div . I want
I have a setup like this: <div class=item> <img src=.../> <span class=item-detail></span> <span class=item-detail></span>
I've got 3 divs lined up; the center div has many position:absolute images (which
I have some HTML with the following approximate structure and positioning: <div class=grand-parent style=position:
I have a text input with a search buton absolute positioned over it... to
I have a container div element that has overflow:hidden on it. Unfortunately this property
I have a div set to the css class float with float being: .float
I have a relatively positioned div within a centred div of width 50%... I
I have a div which position is fixed, within that i have a div

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.