Web Analytics Made Easy -
StatCounter center align group of divs - CodingForum

Announcement

Collapse
No announcement yet.

center align group of divs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • center align group of divs

    Hi all,
    I have a group of divs that have the same height but different width and I'd like to position them at the center of another div. It has to look like this


    these are the css styles used. How should I change these style to get the layout I want? I want the divs-items be placed in the center of div-outer, one next to another, like in the image.

    Code:
    div-outer{
    width:800px;
    height:100px;
    margin:0;
    padding:0;
    text-align:center;
    }
    divs-item{
    height:100px;
    margin:0;
    padding:0;
    }
    Last edited by ktsixit; Apr 15, 2009, 04:01 AM.

  • #2
    I have a group of divs that have the same height but different width [...]
    Can you predict/decide the total width of those inner divs?
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment


    • #3
      well, the inner divs should have a total width less than 800px, which is the outer div's width.
      But I don't know exactly how much this total width is going to be

      Comment


      • #4
        Code:
        div-outer{
              width:800px;
              height:100px;
              margin:0 [COLOR="Red"]auto[/COLOR];
              padding:0;
              text-align:center;
        }
        --> Check me out <--

        Comment

        Working...
        X