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.

Anyone help me centre my nav bar content please.

Featured Replies

Hi.

 

I have edited together a nav bar from a tutorial I followed and got it looking how I want it apart from the fact the text seems to justify towards the left. How do I center it?

 

Click sig for EG

  • Author

Hi Ben.

 

Im not really 100% sure what does what, I was only able to create it as it was part of a tutorial somewhere that I managed to edit to my design. Ive tried editing all parameters and cant seem to get it centred.

 

What part do you say I should add the code you set out above too?

  • Author

bump -anyone?

  • Author
bump -anyone?

 

 

Sorted. Now using a different nav bar ;)

A bit late to reply, but if you've got a fixed width for your navigation bar, you could do something like this in your CSS:

 

div#navigation
{
width: 500px;
position: relative;
left: 50%; /* half the browser's client width */
margin-left: -250px; /* half the #navigation width */
}

 

This positions the #navigation div element at half of the browser's width, whatever the browser window is sized at. The negative left margin then alters the 50% offset from the left of the div to the middle of it, giving making it appear horizontally-centered. Be careful though, as if you resize the browser window below the div's width, it will move beyond the left-most part of your layout... but this can be overcome by, for example, making use of the min-width attribute on the div's parent element.

  • Author

Hey Antom.

 

Whilst I am finished with this Navbar issue its never too late to learn something and it puts me in better stead for the next Navbar drama issue :]

 

Thanks for your help.

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.