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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:12:47+00:00 2026-06-06T21:12:47+00:00

i am trying to code an html with 2 divs inside a div. There

  • 0

i am trying to code an html with 2 divs inside a div.
There is a parent div with no width or height.. the width is the browser width and the height is not specified.
I want inside this parent div, 2 divs: 1st one needs to have a width or 250px and the 2nd one needs to have the rest of the screen’s width. They both are missing the height.. depending how much content there will be inside it.
Now i was trying to make it like this:

<div id="calendar">
        <section id="list">
        </section>

        <section id="grid">
        </section>
</div>

and the css like this:

#calendar {
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
#calendar #list {
    background: #f00;
    position: absolute;
    width: 250px;
    left: 0;
    top: 0;
}
#calendar #grid {
    background: #0f0;
    position: absolute;
    left: 250px;
    top: 0;
    right: 0;
}

now the problem is, the parent div doesnt resize when i add content to the children divs

I hope there is a workaround with the CSS to solve this cause it would be bad to do it via JS.

Thank you in advance,
Daniel!

  • 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-06T21:12:49+00:00Added an answer on June 6, 2026 at 9:12 pm

    Here’s my solution -> http://tinkerbin.com/Z8mJmItU

    Float the #list with its given width, then give #grid the same margin-left.

    Then to get both columns to look like they have 100% of the height of the parent-container you need an image. Before you’d have to use an ‘actual image’. Today you can simply rely on css3 gradients for backgrounds making your page load faster (1 less http request for the image). It may seem more complicated, but it actually isn’t ‘that’ complicated. It even ends up giving you more flexibility since you can change the width and color of the columns without needing to create a new image. All you need is to change the css.

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

Sidebar

Related Questions

I'm trying to add html code inside a <span id=options></span> so I'm trying to
I'm trying to generate the following html code using cl-who: <html> <body> <div id=cnt_1></div>
I'm trying to write a regular expression for html code that looks like this:
I am trying to show some random images in a div. My HTML code
So, I am trying to make floated divs to hide in parent's div, but
I was trying to use the following code to center a <div> inside another
I am trying to render some DIV inside a table td tag using HTML
I'm trying to move child div elements between two different parent divs using jQuery
Trying to customize Symfony2 form to produce html code looking like the following example:
I was trying the next code without success HTML <a id=addBookButton href=javascript:showForm('addBookButton','add-book','activateAddBookForm'); class=addA><span>Add Book</span></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.