Page 1 of 1

help center a DIV container

Posted: 07 Sep 2010, 02:52
by neuropass
Hey guys i'mn trying to center my Div container for my quick reply block. i know center is deprecated so i'm trying to figure out how to do it. the code i'm using is the following, but it's not perfectly centered... what am i doing wrong?


And this is my html:

Code: Select all

<div id="quickreply">

quick reply code here


</div>

This is my Css:

Code: Select all

/* quick reply position
-------------------------------------------------*/

#quickreply {
  width: 1300px ;
  margin-left: 50% ;
  margin-right: 50% ;
}

Re: help center a DIV container

Posted: 07 Sep 2010, 10:01
by Steve
2 options better in the html id say,because of the show hide function, but hey!
one straight into the html:

Code: Select all

<div style="text-align: center;">quick reply code here</div>
You will need to use in variuos places through out the QR html.

html,css option.

html code:

Code: Select all

<div class="qr_center">quick reply code here</div>
followed by css:

Code: Select all

.qr_center {
    text-align: center;
}
you dont need to use an id just class, if you want the centered full code for the quick reply i will post it.