Killersites Community: How do I center my page? - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How do I center my page?

#1 User is offline   TheAppleNewsreel 

  • View blog
  • Group: New Members
  • Posts: 3
  • Joined: 06-March 11

Posted 06 March 2011 - 07:39 PM

I previewed my page in my browser, and found that the whole thing is on the left side of the page. How do I center it like the killersites page, and most other pages? Attached is a screenshot to give you an idea of what I'm talking about. Please note the large white area composing the right side of the screen.
0

#2 User is offline   Eddie 

  • PipPipPipPip
  • View blog
  • Group: Advanced Member
  • Posts: 3,523
  • Joined: 19-December 08
  • LocationTexas

Posted 06 March 2011 - 08:00 PM

Wrap a div around the whole thing. The way you do that is apply the open div just after the open body tag and the a closed div just before the closing body tag.

<body>
<div style="margin: 0 auto; width: 900px;"> Note: set your width to whatever size your framework is.

</div>
</body>
0

#3 User is online   Andrea 

  • View blog
  • View gallery
  • Group: Moderators
  • Posts: 5,498
  • Joined: 19-December 08
  • LocationSan Antonio, TX

Posted 06 March 2011 - 08:02 PM

http://www.csstutori...-page-with-css/
0

#4 User is offline   grabenair 

  • PipPipPipPip
  • View blog
  • Group: Member
  • Posts: 342
  • Joined: 27-February 11
  • LocationIowa

Posted 07 March 2011 - 05:08 AM

This is how I center my page:

#wrapper {
width: 960px;
margin-top: 20px;
margin-right: auto;
margin-left: auto;
}
I put all of my content links,main content ect. inside of the wripper div and use this css to center it in the browser window. The centering part is the margin-right: auto; margin-left: auto; I hope this helps.
Standards will change. But your website needs to remain in serving its audience.
My Portfolio site
0

#5 User is offline   Wickham 

  • PipPipPipPip
  • View gallery
  • Group: Advanced Member
  • Posts: 1,731
  • Joined: 20-December 08
  • LocationSalisbury UK

Posted 08 March 2011 - 01:49 AM

If you have any divs or other elements with position: absolute you will almost certainly need to add position: relative to the wrap div as position: absolute elements will be unaffected unless you do add it:-
<body>
<div style="position: relative; margin: 0 auto; width: 900px;"> 
Note: set your width to whatever size your framework is.
</div>
</body> 

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users