943,923 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Dec 30th, 2008
0

Re: center the page? help

it just choved everything to the right about 500px.
its like it only shows half the page visible on the screen then half of thr rest of the page is pure margin
Reputation Points: 11
Solved Threads: 4
Junior Poster
sacarias40 is offline Offline
113 posts
since Nov 2008
Dec 31st, 2008
1

Re: center the page? help

These are the 'bare' essentials of the CSS centering hack: the width and the margin. If you don't specify a width, the margin trick won't work. If you don't specify the left and right margins as auto the wrapper won't be centered.

You may say: "But I specified a width: 100%!" --- good for you and in truth, your wrapper IS being centered correctly. However, the contents of the wrapper (such as your navigation or content divs) are still aligned to the left since that is the default behavior for elements inside a block.

You can see this behavior by adding border: 1px solid #F00 to your .wrapper div.

Now to fix your problem, you have to specify a width, preferably something slightly greater than the size (or percentage) of the content you put in your wrapper.

Try changing your .wrapper attributes to this:
HTML and CSS Syntax (Toggle Plain Text)
  1. .wrapper{
  2. margin: 0 auto;
  3. width:1015px;
  4. }

Actually, you should start weaning yourself away from absolute positioning (there are exceptions) but your design can be implemented better without it... BAH alright, I'll still fix that search_bar.

Try this:
HTML and CSS Syntax (Toggle Plain Text)
  1. .search_bar{
  2. float: right;
  3. margin: 50px 80px 0 0;
  4. }
Last edited by kanaku; Dec 31st, 2008 at 1:21 am. Reason: added a little extra width (in case the elements have padding)
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 31st, 2008
0

Re: center the page? help

hey it worked, i owe you big!
but the search bar fix you gave me puts it in the wrong position.
its like it cant even go to the right spot.
i would like it to be above the links centerd in the white area to the right.

regards
Reputation Points: 11
Solved Threads: 4
Junior Poster
sacarias40 is offline Offline
113 posts
since Nov 2008
Dec 31st, 2008
0

Re: center the page? help

When I check your site, the page still isn't centered. Why is that?

It's size div.wrapper is still 100%. Tell me when you've updated your site so I can see how to fix the search bar.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 31st, 2008
0

Re: center the page? help

oh yeah sorry, i am working on a localhost server. ill upload it soon.
Reputation Points: 11
Solved Threads: 4
Junior Poster
sacarias40 is offline Offline
113 posts
since Nov 2008
Dec 31st, 2008
0

Re: center the page? help

>.< Crusty logo image is taking up the whole top portion of your nav div. Set the attributes of your .logo class to this:

HTML and CSS Syntax (Toggle Plain Text)
  1. .logo{
  2. border-style:none;
  3. float: left;
  4. }


Then change your search_bar class to this:
HTML and CSS Syntax (Toggle Plain Text)
  1. .search_bar{
  2. display: block;
  3. float: right;
  4. margin: 30px 2px 0 0;
  5. }

You can tweak the margins to fit your layout... I can't estimate how much margin you want.
Last edited by kanaku; Dec 31st, 2008 at 4:41 pm. Reason: made the code 'purtier'
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 31st, 2008
0

Re: center the page? help

thank you you fixed it. and i tweeked the search bar how i wanted it. thank you for your help.

and what mite you suggest i use instead of absolute positioning?

regards
Reputation Points: 11
Solved Threads: 4
Junior Poster
sacarias40 is offline Offline
113 posts
since Nov 2008
Dec 31st, 2008
0

Re: center the page? help

Quote ...
and what mite you suggest i use instead of absolute positioning?
It depends on what your design is. As for your current layout, it can be done with floats and a frequent check at possible values of the display attribute.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Need Help!!! Internet Explore not reading my webpage...
Next Thread in HTML and CSS Forum Timeline: Need Help in HTML





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC