nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> Centering My Site, Want to auto center everything on the page
cranfordguitar
post Sep 22 2009, 11:21 PM
Post #1





Group: Verified NS Member
Posts: 3
Joined: 22-September 09
Member No.: 5,284



My site is looking good so far but I would like it to display evertyhing centered on the page no matter what monitor I use any suggestions the CSS i have from viewing the souce of my page getting the url and downloading it is very cryptic. Any help would be appreciated.
Go to the top of the page
 
+Quote Post
NSTechRyan
post Sep 23 2009, 08:33 AM
Post #2





Group: NetSol Staff
Posts: 86
Joined: 25-July 08
From: Belleville, IL
Member No.: 1,621



QUOTE (cranfordguitar @ Sep 22 2009, 11:21 PM) *
My site is looking good so far but I would like it to display evertyhing centered on the page no matter what monitor I use any suggestions the CSS i have from viewing the souce of my page getting the url and downloading it is very cryptic. Any help would be appreciated.



It appears that you have set the main table alignment to be centered. This is the same as using the CSS to center the site.
Go to the top of the page
 
+Quote Post
cranfordguitar
post Sep 23 2009, 12:30 PM
Post #3





Group: Verified NS Member
Posts: 3
Joined: 22-September 09
Member No.: 5,284



QUOTE (NSTechRyan @ Sep 23 2009, 09:33 AM) *
It appears that you have set the main table alignment to be centered. This is the same as using the CSS to center the site.

The problem I'm having is that on a wide screen everything looks okay but everthing is aligned to the left when on a regular screen.
Go to the top of the page
 
+Quote Post
dsunker
post Sep 23 2009, 12:59 PM
Post #4





Group: Verified NS Member
Posts: 343
Joined: 25-November 08
From: Ohio
Member No.: 3,174



QUOTE (cranfordguitar @ Sep 23 2009, 01:30 PM) *
The problem I'm having is that on a wide screen everything looks okay but everthing is aligned to the left when on a regular screen.

You might want to check the total width of your site. Resolution of the monitor has a lot to with issues like this. If your monitor is set to 1024x768 and your site is 1100px wide, that could be causing the problem.
Go to the top of the page
 
+Quote Post
cranfordguitar
post Sep 23 2009, 02:22 PM
Post #5





Group: Verified NS Member
Posts: 3
Joined: 22-September 09
Member No.: 5,284



QUOTE (dsunker @ Sep 23 2009, 01:59 PM) *
You might want to check the total width of your site. Resolution of the monitor has a lot to with issues like this. If your monitor is set to 1024x768 and your site is 1100px wide, that could be causing the problem.


Can I set the total width of my site to be oh say 800 and have it centered? And is there a way to have it set that way aoutomatically so everything on the page fits?
Go to the top of the page
 
+Quote Post
Diemer
post Sep 25 2009, 01:27 PM
Post #6





Group: Verified NS Member
Posts: 15
Joined: 22-August 09
Member No.: 5,045



QUOTE (cranfordguitar @ Sep 23 2009, 03:22 PM) *
Can I set the total width of my site to be oh say 800 and have it centered? And is there a way to have it set that way aoutomatically so everything on the page fits?


you should have an div element on your page with an id of wrapper. you'll need custom css enabled if you havent done so already (first by telling your theme to not use the default style sheet. you can do this in design/colors... and check the appropriate box). then you would need to atleast set the css as follows.

body{
width: 100%;
}

#wrapper {
width:800px;
margin: 0 auto;
}

lemme break it down for you:

in css # is equal to "id" (and likewise . is equal to "class"). #wrapper means "any element with an id of wrapper". width is obviously setting the width. margin is a little tougher to grasp.

for starters margin can take four inputs or less in a clockwise order starting at the top, but it doesnt always have to. if it has 2 inputs it assumes that the first is top and bottom and the second is left and right. by setting it as :0 auto; you are saying give me no margin on the top and bottom, and give me an equal margin on the left and right, thus giving you a center aligned element.

i know its kind egghead stuff, and i hope that explains it.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2009 Time is now: 21st November 2009 - 06:13 PM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates