Skip to content
View in the app

A better way to browse. Learn more.

OKCCN - XenForo & IPS Plugin Marketplace

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.
  • Language

CSS Center Align

Featured Replies

  • Administrators

CSS Center Align


Center elements
horizontally and vertically


CSS Centering Elements

With CSS, you can center elements (horizontally, vertically, or both) with several methods, depending on the type of element.

Example

Center a div element using flexbox:

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}
Try it Yourself »


Horizontal Alignment

There are several ways to horizontally align elements:

  • margin: auto - Center block elements
  • text-align: center - Center text inside elements
  • float or position - Left/right alignment

Learn more about Horizontal Alignment »


Vertical Alignment

Vertical centering can be achieved using modern layout techniques:

  • Flexbox - Use align-items: center
  • Grid - Use place-items: center
  • Position + Transform - For elements of unknown dimensions

Tip: Flexbox is the most modern and recommended method for centering content both horizontally and vertically!

Learn more about Vertical Alignment »



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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.