Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Best way to centre a page?

Featured Replies

I have done this lots of times before, I was just wondering what other users considerd the best way to centre there web page.

I have done this lots of times before, I was just wondering what other users considerd the best way to centre there web page.

 

I use the margin method with css

 

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

 

The first 0 is the top and bottom margin, the auto is the left and right.

 

You can also use fixed, absolute or relative positioning.

 

#wrapper {
width:960px;
position:fixed;
left:300px;
top:20px;
}

 

I prefer the top method, but it really does depend on what images your using etc

Faevilangel that second method you used wouldn't work?

 

Should be

 

width: 960px;

left 50%;

margin-left: -480px;

  • Author

I tried

 

#wrapper {

margin: 0 auto;

width:960px;

}

 

In a web page today, and i'm not sure if it was IE or something else but it didn't work?

I tried

 

#wrapper {

margin: 0 auto;

width:960px;

}

 

In a web page today, and i'm not sure if it was IE or something else but it didn't work?

 

 

It really depends on how you coded your site and what doctype you used as it if it will work, you can have a look at a tutorial I wrote about it on my blog which might help you out, which is slightly more in-depth then the one I wrote for this forum:

 

http://webdesignpond.co.uk/wdp/tips-tutorials/how-to-horizontally-center-a-site/

 

If that doesn't work then post a link to your site or the code if it is offline and I'm sure someone would be able to help you out :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.