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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:58:31+00:00 2026-06-07T03:58:31+00:00

I have nested div s, with most being float:left; display:block; , like do: <div

  • 0

I have nested divs, with most being float:left; display:block;, like do:

<div class="container" style="display:block;">
    <div style="float:left; display:block; height:100px;">
    <div style="float:left; display:block; height:100px;">
</div>

I want the div container to get bigger without setting a height. At the moment it’s a flat line.
How do I set up the inner divs, so that the container has a height?

TL;DR: Currently I can see the 2 inside div‘s fine, but the container is a flat div (no height).
How do I give it a height?

  • 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-07T03:58:33+00:00Added an answer on June 7, 2026 at 3:58 am

    You have two options:

    <div class="container" style="overflow:hidden">
        <div style="float:left; height:100px;">
        <div style="float:left; height:100px;">
    </div>
    

    or

    <div class="container">
        <div style="float:left; height:100px;">
        <div style="float:left; height:100px;">
        <div style="clear:left">
    </div>
    

    Note that overflow:hidden elements will wrap around floating inner elements. Alternatively, you can use an element to clear the float, which will also make the surrounding element to wrap it’s content.

    Another tip: You don’t have to state that divs are display:block. In HTML, there are basically 2 types of elements, block and inline. Divs are block by default.

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

Sidebar

Related Questions

I have those 2 divs nested into the yellow div, and as you can
So I have a nested div structure and I would like to get the
I have these nested divs and I need the main container to expand (in
Possible Duplicate: nested relative positioned div needs to have a 100% height I haven't
I have a div nested inside another <div id=wrapper> <div id=left></div> <div id=right></div> <div
I have html nested like so <div id=content> <div id=asection> <h1>Some Text</h1> </div> </div>
I have nested div as shown below: <div class=abc> <div class=bcd> </div> </div> I
I have a nested div like this <div id=one> <div id=two> id two goes
I'm using colorbox on a div. I have nested div's. When i click the
If any of the nested div s below have a length longer then an

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.