Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 01-15-2010, 01:44 AM centering problem
Novice Talker

Posts: 7
Name: abeer
Trades: 0
hi i am facing problem wjen i uploded a site for my customer. and i am facing this problem first time

facing centering problem. the site goes on left. i have made a lot of sites but this time i am facing problem and am not finding what is the problem. can any one help me regarding this issue?

site link is

here is the link


best regards
abeer

Last edited by abeer; 01-15-2010 at 01:54 AM..
abeer is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-15-2010, 01:56 AM Re: centering problem
Novice Talker

Posts: 7
Name: abeer
Trades: 0
Quote:
Originally Posted by king john View Post
I always go too far to the left..

Is there any way I could correct this problem? I know practice but how can i tell if I am over the lane line?

here is the sollution and this worked for me everytime//

The best way to center a page is to use a wrapper that contains what you want to center, and this can be done in two simple stages.

Stage one- The CSS
Within your css add something that looks like this code:
body {
text-align:center;
}
#wrapper {
margin: 0 auto;
width: xxxx; /* Replace the xxxx with the the width of your site (eg 800px)*/
text-align:left;
}

A quick explanation of what margin: 0 auto; will do

In the body add text-align:center as this will fix a problem that some browsers have with margin. However this will make all the text in anything be centered so to fix this in the wrapper you will tell all the text to go back to the left, this way you are resetting the default position of the text and will place the text left unless you tell it in a different div/class to be otherwise.
in the wrapper, the 0 is there to tell the top and bottom not to have a margin, this can be changed if you want there to be a top and bottom margin.
The auto tells the left and the right to automatically set a margin. So it takes into account the space that remains and divides it between the left and right margins, making the content centered on the page.

Stage two – The HTML
Now that you have the CSS part done all you need to do is apply the wrapper to the HTML. This is simple, anything that you want to be centered on the page shoul be placed inside the wrapper like this:
<div id="wrapper">
<!-- Place everything you want to be centred here-->
</div>
abeer is offline
Reply With Quote
View Public Profile
 
Old 01-15-2010, 01:58 AM Re: centering problem
Novice Talker

Posts: 7
Name: abeer
Trades: 0
above cod works allthe time for me.. but this time i am facing problem.. i dont know why
abeer is offline
Reply With Quote
View Public Profile
 
Old 01-15-2010, 03:59 AM Re: centering problem
Average Talker

Posts: 19
Name: lucius andre
Trades: 0
try this one:

body {
margin:0;
}
__________________

Please login or register to view this content. Registration is FREE
addlinkurl is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to centering problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29442 seconds with 12 queries