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.

position with minus value

Featured Replies

Hi,

 

Is it advisable to position a page element using negative values?

 

I'm just getting my head around position without using "absolute" for everything. As all good amateurs do apparently!.

 

I'm finding it a bit frustrating because you position one element, create another and everything shifts. Then you have to work out what goes first in the code and what method to use - float, relative, clear . . .

 

I know I've got to get this sorted but it's tricky I find.

The answer is to practice, I suppose.

 

I try not to use negative positions when I'm not using position: absolute, unless I deliberately want to layer one element over another.

 

You should be able to use margins, padding and float to position elements relative to each other.

 

If you use negative positions, you will move the element but it will leave a space where it used to be, which causes problems for the following elements as they think the first element is still there, so you have to add a negative position to the second element, and so on.

  • Author

Thanks, I discovered that using negative values leaves a big gap. Weird that isn't it!

 

I'll give it a miss.I think it's a habit to nip in the bud.

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.