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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:45:47+00:00 2026-05-21T04:45:47+00:00

I’ve got 3 divs lined up; the center div has many position:absolute images (which

  • 0

enter image description here

I’ve got 3 divs lined up; the center div has many position:absolute images (which overlap — one image is visible at a time; the rest are display:none; for jQuery cross-fading, which is not germane).

I changed the center div to be position:relative to enable its child images to be position:absolute. But if I set the left, center, and right div to float:left, it doesn’t display in the order: left, center, right div (the left and right are bunched up on the left).

If I take out position: relative on the center div, it works (but the images can’t be absolutely positioned within the parent div, of course).

How do I position these divs so that I have left, center, right, while the images can be absolutely positioned inside the center? Do I have to set relative for the left and right divs, too?

  • 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-05-21T04:45:48+00:00Added an answer on May 21, 2026 at 4:45 am

    You could do it using the following CSS for each column. Take into account that both #div-left and #div-right must appear in the HTML before #div-center, as otherwise they won’t be at the same top position.

     #div-left {
        float: left;
        width: 100px;
     }
    
     #div-center {
        margin: 0 100px;
        position: relative;
     }
    
     #div-right {
        float: right;
        width: 100px;
     }
    

    Basically, the left and right divs are being floated to each side, with a fixed width. Then the center div is assigned a left and right margin that equals the widths of the divs floating at each side. Because, thanks to the margins, the center div fits between the floats, it appears perfectly aligned between them.

    The position:relative attribute is not needed for the layout (I just added it because you need to position other objects inside this div).

    If you need the full layout to have a fixed width (say, you want the page to occupy a width of 980px), just create a div with this width, and include the three divs inside it.

    You can see the example in action here: http://jsfiddle.net/7pBVX/

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I want to count how many characters a certain string has in PHP, but
i got an object with contents of html markup in it, for example: string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.