How to center the web page ?

They have: 3 posts

Joined: Sep 2010

I want to center the website like this site. My site is aligned to left. I'm using Kampozer web editor.

Can any one help ?

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

You just need to add a margin:auto to your containing div. Not sure specifically how to do that in Kompozer (I'm assuming you mean Kompozer, not Kampozer? Or is that something different?).

If you post a link we can give you more specific instructions.

They have: 1 posts

Joined: Dec 2012

Megan wrote:
You just need to add a margin:auto to your containing div. Not sure specifically how to do that in Kompozer (I'm assuming you mean Kompozer, not Kampozer? Or is that something different?) If you post a link we can give you more specific instructions..

Hi I am using kompoZer and am struggling getting some pages aligned like these samples:

On some PCs they look fine but on my laptop and wide monitors they seem to look crappy eg

http://provennaturalremedies.info/intro.html content borders need to widen to page border width

http://provennaturalremedies.info/cancerremissionsNL.html needs centring

I have struggled to find the exact codes mentioned here on either kompoZer or notepad although I have clicked every imaginable button.

Thanks in advance

chining's picture

They have: 3 posts

Joined: Oct 2010

Kompozer???

Never heard that software, is it good one?

sanseo's picture

They have: 18 posts

Joined: Oct 2010

You need to do some modification in css OR else where you make style sheet code.

I think you need to change it to auto or center in main or body div or table.

hope this will help you. to more share URL of your site.

They have: 4 posts

Joined: Nov 2010

First go to the code editor if your software allows you to edit your website codes or else you can open your page in a notepad. Then find the main table / div tag that contains the body section. Within that table tag add align="center". This will work I hope.

They have: 59 posts

Joined: Aug 2011

Thanks, you are giving a best solution. I have a one question about div tag. When w3c check my site. Then div not allows nofollow tag. Can you give me solution.
{link removed}

They have: 1 posts

Joined: Aug 2011

Try encapsulating the entire contents of the page in a global

Code: Select all
index.html:
@@ -26,6 +26,7 @@

+

@@ -114,4 +115,5 @@ Women's Rights, rights, choice, Document

+

Then moving the size and border style you've applied to the document's entire body, to that new div (and adding a centering style while you're in there Smiling)

Code: Select all
2col_leftNav.css:
@@ -10,9 +10,11 @@
body{
font-family: Arial,sans-serif;
color: #333333;
line-height: 1.166;
- margin: 20px 20px 0 20px;
- padding: 0px;
+}
+
+div#body {
+ margin: 0 auto;
width: 770px;
border: 2px solid #669999;

They have: 30 posts

Joined: Feb 2011

Thanks for the code given by you. This is what i am looking for..

They have: 6 posts

Joined: Nov 2011

Hi, Use Html tag to align any content in center on web pages.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.