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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:19:16+00:00 2026-06-03T23:19:16+00:00

cool so i have been exploring CSS with HTML fo about a month now

  • 0

cool so i have been exploring CSS with HTML fo about a month now and the one thing i am still struggling with is how to get a element to adjust its height based on the height on the children. so for example i have a news button that will take me to a page that has links to an archive of articles printed at different times, the articles vary in length, but the content element that holds it all, always allows the articles to overflow and then i have to use scroll, is there away to set the height to adjust to the children elemets inside.

i have tried:

height: 100%;

if i inspect element the metrics say its at 647px. and then it stays there

height: auto;

sets the height at 200px, and everything is overflowed.

this is a section of html nesting..

 <div id="news_head">
 </div>
 <div id="news_content">
   <div id="news_scroll">
   </div>
   <div id="news_main_page">
   </div>
   <div id="side_archive">
   </div>
 </div>
 <div id="disquss_section">
 </div>

the css for this is:

#news_head {
  border: 1px solid red;
  height: 200px;
  width: 100%;
}

#news_content {
  border: 1px solid red;
  height: 100%;
  width: 1200px;
  margin: 5px auto;
}

#news_scroll {
  border: 1px solid green;
  width: 1198px;
  height: 200px;
}

#news_main_page {
  border: 1px solid blue;
  width: 988px;
  height: 430px;
  float: left;
}

#side_archive {
  border: 1px solid yellow;
  width: 200px;
  height: 430px;
  float: right; 
}

i am using the bordering just to see a visual as to what is going on. i have read some things but i am not exactly sure how to implement it here, http://css-tricks.com/snippets/css/center-div-with-dynamic-height/.
any help, i am using JavaScript and jQuery as well, so any suggestions are welcome.

  • 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-03T23:19:17+00:00Added an answer on June 3, 2026 at 11:19 pm

    If you float content inside container div (if it doesn’t have any other non-floated content), it will remain 0, but to fix this, you can add a

    <div style="clear: both"></div>
    

    before your parent elements ends (so right before of your parent). I’ts not the most elegant solution, but works like charm, and there are no real alternatives that i know of.

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

Sidebar

Related Questions

I have a cool snippet of code that works well, except one thing. The
I have been building IMO a really cool RIA. But its now close to
I have been using Photoshop for about three weeks now, finding it very different
I've been playing around with d3.js and it's pretty cool. I need to have
I have recently focused on drawing some cool shapes in a HTML 5.0 canvas.
I have been playing with the very cool btree applet at slady.net . I'm
I have been using the cool reflection class in my framework. I wonder whether
i have been struggling to connect to erlang node and with no luck. The
CC.Net is pretty cool and we have been using it in our organisation for
Hi I have been using Emacs23 for some time now and find it a

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.