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.

CSS Alignment Issue - Need my Nav to align right...

Featured Replies

Ok, I'm sure that I am missing something obvious here, but I cannot seem to get my Nav bar to align right.

Its really frustrating me, tried the float:right and also margin:auto, but not getting anywhere.

Do you have any ideas?

This website is responsive/elastic, so I am reluctant to resort to fixed pixel widths or even percentages if I can avoid them (although will try this if I have to)

There must be a simple way of just telling a div to align to the right?

 

http://www.mason-uk.co.uk/responsive/html5boilerplate5-newnav.html

Edited by AblazeRich

You could add a float:right; style to the .nav class.

 

.nav {
list-style: none;
background: #4a5f6d;
font-size: 12px;
font-weight: bold;
float: right;
}

Just add

 

position: relative; left: 255px;
 

 

or

 

float: right;
 

 

to your .nav

 

EDIT: Lyndsey ninja'd in before me :ph34r:

Edited by Alluziion

Just add

 

position: relative; left: 255px;
 

 

or

 

float: right;
 

 

to your .nav

 

EDIT: Lyndsey ninja'd in before me :ph34r:

 

:ph34r:

  • Author

Thanks but I already tried float right and it doesn't seem to work in this case, dunno why, v.annoying

 

Also this is a responsive/elastic design, so I can't really used fixed pixels...

Edited by AblazeRich

Thanks but I already tried float right and it doesn't seem to work in this case, dunno why, v.annoying

 

Also this is a responsive/elastic design, so I can't really used fixed pixels...

 

Worked for me using Web Developer plugin.

Maybe it's conflicting with something... try adding !important and see if it works and if it does, try and find out what's overwriting the style.

  • Author

Thanks guys it just started working for some reason.... dunno why it wasn't before? Perhaps there was a glitch with my FTP upload, it did it to me the other day too...

Thanks

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.