user1231561
user1231561

Reputation: 3359

Div container within main wrapper won't center

I basically have a #wrapper , #contentWrapper , #actualContent

I have my #wrapper centering the viewport, with width 940px; however I cant get my #actualContent to center within the main wrapper.

Any suggestions?

JSFiddle example here

Upvotes: 1

Views: 1012

Answers (2)

Anuj Kaithwas
Anuj Kaithwas

Reputation: 842

Check this, I hope this is what you need. You gave unnecessary width and margin

Upvotes: 0

dsgriffin
dsgriffin

Reputation: 68626

Use display: inline-block; on your content div and text-align:center in your parent div. Also remove the width:100% from the content.

Here's the jsFiddle.

#wrapper {
    margin: 84px 0 0 0;
    width: 500px;
    border: 1px solid #000000;
    text-align: center;
}

#content {
    padding: 27px 0 27px 0;
    display: inline-block;    
}

Upvotes: 1

Related Questions