Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

How to limit the horizontal scroll when visitng a website

How can you limit the horizontal scroll when someone visits your website? If you go to cnn.com
or apple.com  or http://www.marketwatch.com for example there is no horizontal scroll bar at all. Some sites have horizontal scroll bars, but you can only scroll to the right about a half an inch.

I ask this because I have created a website. The website has a banner image that is
1260 x 170 pixels. It looks good, but when viewed in a browser, their is a horizontala scroll bar that allows the application user to scroll horizontally to the right by about two inches.  

Also if the website is viewed on a really wide screen, the end of the banner image is visible and looks too short.

0
brgdotnet
Asked:
brgdotnet
  • 3
  • 2
1 Solution
 
BadotzCommented:
Using CSS:

body { overflow: none; }

Then if you need scrolling elsewhere, you can explicitly enable it:

spill { overflow: auto; }
0
 
brgdotnetAuthor Commented:
I think you meant "overflow: hidden"

I tried that and "overflow: auto; "

but they are not working. With "overflow: auto" I get scroll bars embedded in my web page that are not part of the browser. So the problem is still unsolved.
0
 
brgdotnetAuthor Commented:
I want to add more points for this question. I don't see a link to edit the question and to increase the points, so I will delete this question and re-post it with some sample source code. So if anyone has a solution, please respond to my new question.
0
 
brgdotnetAuthor Commented:
Badotz, you are correct. I mad a mistake and told you it was wrong. But your solution does work. Thank you!
0
 
BadotzCommented:
No worries - glad to help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now