No Centering!

MrNah

New Member
Hey all,
I recently purchased some webspace and created a webpage with Microsoft Publisher. Nothing super specail but it made me a webpage that does the trick! When the page is loaded on any computer it doesnt center itself of the internet browser. rather it is stuck to the left side. I'm not 100% sure on how to fix this. I tried going into the html and putting <center> </center> right between <html> and <body> but that sure didnt work. Anyone know the trick?
 

Streamline

New Member
Quick fix...

Simple problem to fix.

In your body css type in:
Code:
text-align: center;

Then your your wraping Div or table CSS put:
Code:
margin: 0 auto;
 

adamblan

New Member
To add to Streamline's solution:

If you define a width < 100% for the containing <div> and set it's side margins to auto, this will center the div.

Setting text alignment to center will center the content within that div.

So:

<div style="width:800px; margin:auto; text-align:center">
<p> Your centered content</p>
</div>
 

joe

New Member
Hey all,
I recently purchased some webspace and created a webpage with Microsoft Publisher. Nothing super specail but it made me a webpage that does the trick! When the page is loaded on any computer it doesnt center itself of the internet browser. rather it is stuck to the left side. I'm not 100% sure on how to fix this. I tried going into the html and putting <center> </center> right between <html> and <body> but that sure didnt work. Anyone know the trick?

I know it's not the official way to do things, but sometimes the easiest. The center tags should go after <body> tag. Might place <center> right after <body> and </center> right before </body>
 
Top