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.

positioning causing unwanted overflow.

Featured Replies

Hi there,

as the the titled says, I am using some relative positioning for some awkward div placement, but it has an effect on my overall page.. making it scroll a bit further than I would like.

 

an example is at the bottom of the page here:

http://www.georgianwines.ie/vineyards.php

 

both the map and 'back to top' link are the likely causes of this, im sure, but is there anyway to limit the page scrolling size?

thanks guys, any help is appreciated muchly!

Hi mate

 

its to do with the div id "mainscroll" height I think.

It's the <p> tag that's wrapped around the 'back to top' link that's causing it to happen.

 

The easiest fix would be to give it a width of around 150px, but it would be better if you re-built the layout without all the position relatives.

  • Author

thanks for the comments guys. i tried playing around with the <p> tags, but still seems to persist. even if i swap them for a <span>. I guess the only option is to backtrack and undo the relative positioning, although im not sure that will be possible either, due to space issues, and overlapping elements/png images..

thanks for the comments guys. i tried playing around with the <p> tags, but still seems to persist. even if i swap them for a <span>. I guess the only option is to backtrack and undo the relative positioning, although im not sure that will be possible either, due to space issues, and overlapping elements/png images..

 

 

You're <p> tag has an inline style of left:600px. change this to margin-left and it should fix the scrollbar problem.

 

 


</div><!--close mainscroll-->
<img src="images/map_big.png" width="700" height="505" style=" padding: 0; padding-left:40px; position:relative; top:-350px;" />
<p style=" position:relative; top: -400px; left: 600px;"><a href="#top">Back to the top </a><img src="images/uparrow.png" width="9" height="9" /></p>
<script>

 

P.S. It generally works better if you use absolute positioning within a relative container.

 

So making the wrapper absolute, you'd be positioning stuff within the confines of that wrapper, as opposed to the document boundaries.

Edited by bocaj

Change top: -350px; to margin-top: -350px;

<img src="images/map_big.png" width="700" height="505" 
style=" padding: 0; padding-left:40px; 
position:relative; margin-top:-350px;" />

It worked for me in Firefox and IE9.

When you use a negative top it moves the item but leaves a space where it would have been. Negative margin-top doesn't leave a space below.

I didn't change any other code, so I didn't do any of the suggestions above.

Edited by Wickham

Change top: -350px; to margin-top: -350px;

<img src="images/map_big.png" width="700" height="505" 
style=" padding: 0; padding-left:40px; 
position:relative; margin-top:-350px;" />

It worked for me in Firefox and IE9.

When you use a negative top it moves the item but leaves a space where it would have been. Negative margin-top doesn't leave a space below.

I didn't change any other code, so I didn't do any of the suggestions above.

 

Have you tried - overflow-x:hidden;

?

 

Try: overflow-x: hidden;

Change in your style.css

 

body {

background-color: #553C19;

margin: 0px;

padding: 0px;

background-image: url(images/bg_repeat4.jpg);

}

 

to

 

body {

background-color: #553C19;

margin: 0px;

padding: 0px;

background-image: url(images/bg_repeat4.jpg);

overflow-x: hidden;}

Edited by GigafishLabs

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.