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

  • SEARCH
  • Home
  • 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 8498331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:22:23+00:00 2026-06-11T00:22:23+00:00

I need to keep the height of the box the same as the height

  • 0

I need to keep the height of the box the same as the height of the image. When the kitten (example) image is 398px height, the div shall have the same height.
The Problem is, that the other children div, inside the .item div expand the parent div with approx. 150px.

How can I stop this behaviour?
I tried several other methids like overflow:hidden/auto etc. but nothing worked fine.
Need help please! 🙂

HTML:

<div id="container">
    <div class="item">
        <img src="http://placekitten.com/g/398/398" />
        <div class="box">
            <span id="header-content">
                Lorem ipsum dolor sit amet, consetetur sadipscing elitr
            </span>
        </div>
        <div class="headlineblog"><h1>Headline</h1></div>
        <div class="cat"><h2>Category</h2></div>
    </div>
</div>​

CSS:

#container {}
.item {width: 398px;float:left;margin: 10px;overflow: hidden !important;}
.item > img {width: 398px !important}
.item .box {background-color: white;
margin: 10px;
height: 65px;
position: relative;
top: -110px;
font-size: 14px;
color: #BBBDBE;
min-height: 65px;
padding: 10px;
width: 358px;

}
.cat {position: relative;left: 280px;bottom: 230px;}
.cat h2 a{font-size: 14px;text-transform: uppercase;font-weight: 300;color: #FF6400}
.headlineblog {position: relative;left: 20px;bottom: 195px;}
.headlineblog h1 a{font-size: 18px; color: black; font-weight: 700}
.item .box #header-content { position: absolute; bottom: 10px;font-size: 14px;font-weight: 300;color: grey;width: 310px;text-overflow: ellipsis;overflow: hidden;-o-text-overflow: ellipsis;white-space: nowrap; }​

Live DEMO

  • 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-06-11T00:22:25+00:00Added an answer on June 11, 2026 at 12:22 am

    You can set .item to have position: relative, and the necessary children to have position: absolute, adjusting their top/bottom positioning a bit.

    • http://jsfiddle.net/aK4vy/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div with a specific width and height. And a smaller image
I keep finding that if I have nested divs inside each other, and one
I have a dropdown panel that I have just implemented and need to keep
I need to keep a colcounter variable inside the loop that will be used
For my application I need to keep track of all files that are touched
In one of my Android Application I need to keep the title bar same
I have a div box and whenever I move over, a tooltip will appear
Does anyone know of any jQuery Script that will keep a div centered in
I need to keep a footer on bottom, but its height is variable so
I running into an infinite loop problem. I have two numeric up/down controls (Height

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.