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.

Trying to position 2 elements with z-index, help please

Featured Replies

hey I'm trying to position the photo gallery and contact us button on this page: My link

 

I think the Contact us button is being pushed down by the list of images for the light box/photo gallery so I'm using the z-index property t oposition the contact us button to overlap on top of the list of images. Having trouble getting it right. This is my CSS:

 

.contactButton  {
margin-top: -70px;
position: relative;
z-index: 10;
}

.lightbox  {
position: relative;
	margin-top: 12px;
	z-index: 1;	
}

 

Can anyone help me out? The z-index is working on both as I tested with '-1' but how do I make the contact button move up?

 

cheers :)

hey I'm trying to position the photo gallery and contact us button on this page: My link

 

I think the Contact us button is being pushed down by the list of images for the light box/photo gallery so I'm using the z-index property t oposition the contact us button to overlap on top of the list of images. Having trouble getting it right. This is my CSS:

 

.contactButton  {
margin-top: -70px;
position: relative;
z-index: 10;
}

.lightbox  {
position: relative;
	margin-top: 12px;
	z-index: 1;	
}

 

Can anyone help me out? The z-index is working on both as I tested with '-1' but how do I make the contact button move up?

 

cheers :)

 

Why dont u use something like absolute position

 

.contactButton  {
position: absolute;
top:100px;
       left:50px;
}



 

You will have to change the top and left values i just plugged in some for this example :)

  • Author

hey webdesigner93, that worked cheers. For some reason I thought absolutely positioned elements moved about when u resized the browser window, but they do the opposite clearly! dont know what I was mixing them up with.

 

cheers for the help :)

hey webdesigner93, that worked cheers. For some reason I thought absolutely positioned elements moved about when u resized the browser window, but they do the opposite clearly! dont know what I was mixing them up with.

 

cheers for the help :)

 

No problem glad to help and thanks for the +1 cheers :crazy:

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.