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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:58:28+00:00 2026-05-27T03:58:28+00:00

I have a div that contains inside 3 ‘floated’ divs. The containing div has

  • 0

I have a div that contains inside 3 ‘floated’ divs. The containing div has a line of text. The three floating inner divs also have a line of text.

When I specify text-align center for the outermost containing div, the three nested divs appear first, on one row next to each other left-to-right, and THEN the containing div’s text appears to the right of the contained divs, centered in the space to the right of them.

Instead, I don’t understand why the outermost containing div’s text will not appear centered in the browser window, then below that the 3 contained divs and their text would appear. That’s what I need to happen.

Here is the code. By the way I tried to embed a .jpg image into this question so you can see the problem — anyone know how to display a screenshot or .jpg into a question here?

<head>

<style>
#myRowStyles
{
  text-align:center;
  margin-bottom:100px;
  background-color:#b0e0e6;
  border: 1px solid red;
}       

#leftSide
{
  width:120px;
  float:left;
  margin-left:10px;
  margin-top:30px;
  border: 1px solid red;
}

#centerPiece
{
  width:120px;
  float:left;
  margin-left:10px;
  margin-top:30px;
  border: 1px solid red;
}

#rightSide
{
  width:120px;
  float:left;
  margin-left:10px;
  margin-top:30px;
  border: 1px solid red;
}
</style>
</head>


<div id="myRowStyles"><b>THIS IS THE TOP OF THE ROW</b>
   <div id="leftSide">  LEFT SIDE -- Leftie
   </div>
   <div id="centerPiece"> Centerpiece, Folks.
   </div>
   <div id="rightSide">  All Righty -- RIGHT SIDE
   </div>
</div>
<div style="clear:both">
</div>
<div id="myRowStyles"><b>THIS IS ROW #2</b>
   <div id="leftSide">  LEFT SIDE -- Leftie
   </div>
   <div id="centerPiece"> Centerpiece, Folks.
   </div>
   <div id="rightSide">  All Righty -- RIGHT SIDE
   </div>
</div>
  • 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-27T03:58:28+00:00Added an answer on May 27, 2026 at 3:58 am

    I think that to make divs behave like tables you must define the display attributes in CSS:

    #container {
    display: table;
    }
    
    #row  {
    display: table-row;
    }
    
    #left, #right, #middle {
    display: table-cell;
    }
    

    So you will also need to add an extra <div> at the beginning for the container. I haven’t tested this.

    Also, I dont think you can make a single row span 3 columns when using DIVs so you must do something like this:

    <head>
    
    <style>
    
    #container {
      width:90%;
      float:center;
      margin-left:10px;
      margin-top:30px;
      border: 1px solid blue;
      text-align:centre;
      display: table;
    }
    
    #myRowStyles
    {
      text-align:center;
      background-color:#b0e0e6;
      border: 1px solid red;
      display: table-row;
    
    }       
    
    #leftSide,#centerPiece,#rightSide
    {
      width:120px;
      margin-left:10px;
      margin-top:30px;
      border: 1px solid red;
      display: table-cell;
    
    }
    </style>
    </head>
    
    <div id="container">
    <div id="myRowStyles">
       <div id="leftSide"> 
       </div>
       <div id="centerPiece"> Row 1
       </div>
       <div id="rightSide"> 
       </div>
    </div>
    <div id="myRowStyles">
       <div id="leftSide">  LEFT SIDE -- Leftie
       </div>
       <div id="centerPiece"> Centerpiece, Folks.
       </div>
       <div id="rightSide">  All Righty -- RIGHT SIDE
       </div>
    </div>
    
    
    <div id="myRowStyles">
       <div id="leftSide"> 
       </div>
       <div id="centerPiece"> Row 2
       </div>
       <div id="rightSide"> 
       </div>
    </div>
    <div id="myRowStyles">
       <div id="leftSide">  LEFT SIDE -- Leftie
       </div>
       <div id="centerPiece"> Centerpiece, Folks.
       </div>
       <div id="rightSide">  All Righty -- RIGHT SIDE
       </div>
    </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TD that contains two divs. The first div contains text and
I have a search component that contains a text and span inside a div
I have a div that contains some text and the div has a background
In a web application, I have a page that contains a DIV that has
I have a div element that has an id and this div contains a
I have a div that has it's opacity set to 60. Inside the div,
I have a div that contains a paragraph, a list and a right-floated div.
If I have a div that contains other divs, how do I make it
I have two DIVs, first one has a link in it that contains the
I have a DIV that contains many input text. I need a way in

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.