Aligning with CSS
-
hello all, My page was built using
's from CSS. Now I want the whole page to be centered but I am not able to do it. In my CSS file I have entered: body{ text-align:center} but nothing goes on. Can anyone help me out here please. Regards, Tiruvan
One way of doing it is to put all your content into one DIV tag. Then you need to align the outer DIV as such:
DIV.master {position:absolute; width:600px; left:50%; left-margin:-300px;}
Notice that the left-margin must be minus half of the width in order to align it in the center. This also works for horizontal aligning. Ofcourse, if you have used ABSOLUTE positioning for your content you will have to change it to RELATIVE in order to use as origin the top left coords of the master div instead of the top left coords of the BODY. Hope that I helped. theJazzyBrainExcelence is not an act, but a habbit
Aristotle
-
hello all, My page was built using
's from CSS. Now I want the whole page to be centered but I am not able to do it. In my CSS file I have entered: body{ text-align:center} but nothing goes on. Can anyone help me out here please. Regards, Tiruvan