center the page? help

Reply

Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: center the page? help

 
0
  #11
Dec 30th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: center the page? help

 
1
  #12
Dec 31st, 2008
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)
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: center the page? help

 
0
  #13
Dec 31st, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: center the page? help

 
0
  #14
Dec 31st, 2008
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.
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: center the page? help

 
0
  #15
Dec 31st, 2008
oh yeah sorry, i am working on a localhost server. ill upload it soon.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: center the page? help

 
0
  #16
Dec 31st, 2008
>.< 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'
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 74
Reputation: sacarias40 is an unknown quantity at this point 
Solved Threads: 0
sacarias40's Avatar
sacarias40 sacarias40 is offline Offline
Junior Poster in Training

Re: center the page? help

 
0
  #17
Dec 31st, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: center the page? help

 
0
  #18
Dec 31st, 2008
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.
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum


Views: 1174 | Replies: 17
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC