April 3, 201214 yr 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!
April 4, 201214 yr 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.
April 5, 201214 yr 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..
April 5, 201214 yr 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 April 5, 201214 yr by bocaj
April 5, 201214 yr 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 April 5, 201214 yr by Wickham
April 6, 201214 yr 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 April 6, 201214 yr by GigafishLabs
Create an account or sign in to comment