PDA

View Full Version : Liquid Layout trouble...



hj8ag
01-04-2012, 07:46 AM
EDIT: So I was making a stupid error - Looking at it again in the light of day I was applying the margin to the wrong DIV. Thread can be deleted!

Hi All,

Having a little bit of trouble with a new WIP layout and tearing my hair out with a simple problem -

I'm looking for my video content box to be centred within the main containing frame - Normally I'd use 'margin-left: auto; margin-right: auto;' to do this, and this is what I'm trying to use at the moment, it just doesn't seem to be working!?!!

Here is my CSS:


.rightbar {
width: 100%;
margin-left: auto;
margin-right: auto;
}

.videobox {
width: 657px;
height: 435px;
background-color: #FFFFFF;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-indent: 9px;
padding-top:9px;
padding-bottom: 9px;
}


And then I am organising content like this:


<div class ='rightbar'><div class='videobox'>VIDEO HERE</div></div>

Anybody know where I am going wrong here?!