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.

positioning my layout central

Featured Replies

hey,

 

ive got this bit of code that keeps my page content central when i load it onto the browser.

 

works lovely in firefox but when i use IE the page layout goes to pot,

 

please help.

 

the code im using is ...

 

<div id="tipDiv" style="position:absolute; z-index:100"></div>

<div align="center">

 

ive had a mess around and im pretty sure that its the 'z-index:100"></div>' that is causing the problems.

 

thanks to anyone that can help me out.

 

 

d

<div style="width: x; margin: 0 auto;">

always works for me in every browser to center my layout.

</div>

 

Wildo

doesn't z-index make things bigger.

The z-index property sets the stack order of an element. An element with greater stack order is always in front of another element with lower stack order.

 

What makes your page centered is "margin: 0 auto;" - this basically means 0 top and bottom margins and the right and left margins are automatically set within the browsers window width - thereby making your layout central. It's always best to use this in conjunction with "text-align: center;" within your body tag.

  • Author

thanks for this assistance....all sorted and working fine.

 

 

d

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.