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.

Need to centre something

Featured Replies

Ok I've been at my computer too long and my minds gone a bit frazzled. Could anyone give me a pointer on how to centre the navigation on a site I'm working on? I want it to be centred underneath the header image. I know there are problems with the site by the way I'm only about 2 hours into the design and build of it.

 

http://benanderton.co.uk/sdvs/

 

Cheers for any help :).

 

Edit: Also anyone got any ideas on a more elegant replacement for the Iframe? The client needs to be able to use Google Calendar but there has to be a better way of incorporating it?

Hi Cabbage, because you're floating the menu left, it will always stay at the left, so you need to nest the menu in a sort of wrapper:

 

<div id="nav-wrap">
<div id="nav">
	<ul>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
	</ul>
</div>
</div>

/*
*/

#nav-wrap {
width:full width;
height:full height;
text-align:center;
}

#nav {
width:width of menu (not the same as nav-wrap);
margin:0 auto;	
}

  • Author
Hi Cabbage, because you're floating the menu left, it will always stay at the left, so you need to nest the menu in a sort of wrapper:

 

<div id="nav-wrap">
<div id="nav">
	<ul>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
		<li>Menu Item 1</li>
	</ul>
</div>
</div>

/*
*/

#nav-wrap {
width:full width;
height:full height;
text-align:center;
}

#nav {
width:width of menu (not the same as nav-wrap);
margin:0 auto;	
}

 

Cheers, ended up using something slightly different in the end (bit of a bodge job, temporary measure to show someone tomorrow) but I'm sure I'll wind up using this in the final version.

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.