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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:13:25+00:00 2026-06-15T14:13:25+00:00

I have 3 divs vertically. The first should have 100% width, the second should

  • 0

I have 3 divs vertically. The first should have 100% width, the second should have an image with width 283px, and third div should have 100% width.
Does anyone know how to position the image div in the middle of two others divs 100%?

I’ve tried this, but dont works for me

<div class="content">
<div class="first">1</div>
<div class="third">3</div>
<div class="second">2</div>
</div>

.first{
  width:100%;
  float:left;
  background:yellow;
}
.third{
   width:100%
   float:right;
   background:pink;
}
.second{
   width:283px;
   overflow:hidden;
   background:blue;
}​enter code here
  • 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-15T14:13:27+00:00Added an answer on June 15, 2026 at 2:13 pm

    If your intention is to position the divs next to each other horizontally than you can’t have any of them set to a width of 100% as the total of all elements next to each other can only total 100%.

    If your website will be fixed width than your easiest solution would be to set the width of the left and right div in pixels to the (width of the site – 283) / 2. Then they would float next to each other. You could also do this with %.

    However if your site is fluid width, then you would need to work out a percentage for all 3 divs i.e 33% each but this would mean the middle won’t be exactly 283px.

    The only way I can think to make this work exactly as you want would be to use Javascript to resize the elements after the page load which could then get the browser dimensions and work it all out.

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

Sidebar

Related Questions

I have three divs, within a content div. Container width 70%. Within that I
Is it possible to stack three DIVs vertically and have just the middle div
I have 2 divs that I want to centre vertically inside another div. At
I have several vertically stacks divs and I want to have a div appear
I have two divs floated next to one another: <div id=parent> <div id=child_1 style=float:left>
I have 2 divs that positioned horizontally ( float:left; width:50%; ). But i want
I have two divs: <div class=outer> <div class=inner>Example</div> </div> And I have a jQuery
I have 2 divs, each has a background image and I want them to
I have a page with 2 divs. The first one is floated. The 2nd
I have an ASP.NET repeater, which contains 3 divs inside the ItemTemplate. Each div,

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.