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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:28:19+00:00 2026-05-23T11:28:19+00:00

I have a wrapper surrounding a header with content inside as well as a

  • 0

I have a wrapper surrounding a header with content inside as well as a container with content inside. The wrapper is really on there to keep everything positioned to each other accordingly within the confines I set, as well as to center everything. I have my container to automatically re-size according to the content that goes inside of it, this works without issue. However, the wrapper around the header and the container won’t follow the same rule and ends up taking a height of 1px it seems. Please note: the code below will show the wrapper outlined by a dashed white border up at the top, it should instead wrap around everything it contains.

Here’s the code to the website on jsFiddle.

Any help would be greatly appreciated. I feel as though I closed all of my floats, I don’t see why the height: auto; on wrapper won’t work, but maybe there’s something I’m missing.

  • 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-23T11:28:20+00:00Added an answer on May 23, 2026 at 11:28 am

    height: auto on #wrapper isn’t working because virtually every element inside it has position: absolute.

    What does position: absolute do? http://www.w3.org/TR/CSS21/visuren.html#absolute-positioning

    In the absolute positioning model, a
    box is explicitly offset with respect
    to its containing block. It is
    removed from the normal flow entirely
    (it has no impact on later
    siblings).
    An absolutely positioned
    box establishes a new containing block
    for normal flow children and
    absolutely (but not fixed) positioned
    descendants. However, the contents
    of an absolutely positioned element do
    not flow around any other boxes.

    The choices to fix your problem:

    • Give #wrapper an explicit height – but that won’t work if you don’t know the height beforehand.
    • As @jeroen said: use JavaScript to set the height of #wrapper.
    • What you should really do is completely redo your CSS:
      position: absolute is not how you should position every element on the page. You should use floats instead.

    For a comparison of using position: absolute vs floats, see:

    http://www.htmldog.com/guides/cssadvanced/layout/

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

Sidebar

Related Questions

I have 3 blocks: one wrapper and 2 other inside the wrapper. Inside-blocks have
I have a wrapper div which contans 2 divs next to each other. Above
I have a main wrapper div that is set 100% width. Inside that i
I have a #wrapper div and a #grid div nested inside. currently I can
I have a wrapper of certain width. I want to float 3 boxes inside
I have a header. Below that header I have a wrapper containing 2 divs
I have a wrapper div1, with div2 inside which contains a string. When i
So basically i have this wrapper div, and all the elements inside it are
I have a wrapper div containing 10 thumbnail divs each of which contains 10
I have a wrapper class that contains all the content on the web page.

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.