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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:59:26+00:00 2026-06-14T14:59:26+00:00

I have two divs, they look like this: <div style="float:left;">blah</div> <div>blah1</div> In screen resolution

  • 0

I have two divs, they look like this:

<div style="float:left;">blah</div>
<div>blah1</div>

In screen resolution x, these appear as planned like so:

blah blah1

However, in screen resolution less than x, these appear like so:

blah

blah1

This is a width error. How can I get my divs to adjust the width so this doesn’t happen? My widths are set as percents, not as fixed pixels lengths.

NOTE: If possible, I need a way to fix this with auto widths. The content changes per page, so I cannot set even percent widths…. Unless ABSOLUTELY necessary!!

  • 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-14T14:59:27+00:00Added an answer on June 14, 2026 at 2:59 pm

    Just set a margin on the second div:

    <html><head></head><body>
    
    <div style='float:left;width:200px;background:yellow'>First Div</div>
    
    <div style='margin-left:200px;background:orange'>Second Div</div>
    
    </body></html>
    

    …and it will fill all the extra space, every time.


    The markup above looks like this:

    enter image description here

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

Sidebar

Related Questions

I have two divs floated next to one another: <div id=parent> <div id=child_1 style=float:left>
If you have two divs contained within a div: <div style=border:1px;> <div style=float:left;background-color:red;width:20px;height:20px;> <div
I have two divs inside a container div. One need to float left the
I have two divs one inside another, i would like to overlap one div
I have two divs. I would like to move/populate the text from div id
I have two divs floated left so that they appear next to each other.
I have two divs, one with float: left and the other one with float:right.
I'm trying to accomplish a layout like the one below: Two float:left divs are
I have my screen divided into two DIV s. In the left DIV I
I have two divs sr-left-checks and sr-right-checks. they both contain unordered lists. The left

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.