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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:43:10+00:00 2026-06-02T03:43:10+00:00

I have two divs diva and divb . They have a fixed height of

  • 0

I have two divs diva and divb. They have a fixed height of 30px. I want to display them in a single line, one after the other. This can be done by giving them widths of 10% and 90% respectively and by float: left. This works fine. But I gave them a border of 1 px and this disturbs the calculation. I gave the second div a width of 88% and is working. But there is an empty space after that div.

I want both the divs to display in a single line. The page re sizes and I want divs to fill space and so that I can’t give them fixed width. The first div may be given a fixed width, because I just want it 150 px wide. But the second div must be wider to fill space.

What I am getting is this;

Current layout

and I want this:

Expected layout

Here is the fiddle.

  • 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-02T03:43:12+00:00Added an answer on June 2, 2026 at 3:43 am

    Add a width: 100% to the body and specify float: left; on div1 and remove the float: left; on the div2.

    If you’re using percentage widths or heights on child elements you have to specify a percentage width or height on the parent or rather container element as well.

    That should fix it! 🙂

    See this fiddle here

    Good luck!

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

Sidebar

Related Questions

i have two divs with the same ids but one has display=none and the
I have two divs, one inside the other, and i want block the inside
I have two divs. I want one with id hor_rule to appear beneath the
I have two divs. One of them contains an input field the other a
I have two divs with width 100%. I want one to always be on
I have two divs that are not nested, one below the other. They are
I have two divs one inside of the other, now i want to put
i am loading two divs in a page: divA and divB i have divB
I have two divs that I want to show one and hide the other
I have two divs inside a div, I want them both adjacent to each

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.