Results 1 to 4 of 4

Thread: How to hide Horizontal scrollbar in HTML & CSS

  1. #1
    Join Date
    Feb 2009
    Posts
    56

    How to hide Horizontal scrollbar in HTML & CSS

    Hello World,

    I have image which is much larger in size and when i paste that image horizontal scrollbar automatically comes and i don't want that i would like to know how to hide the horizontal scrollbar even if my image exceed the required screen resolution?

    it would be ok if vertical scrollbar remains but the horizontal scrollbar should be hidden.

    i have tried inserting the following code.to hide the horizontal scrollbar but it hide the vertical scrollbar as well

    Code:
    body style="overflow-y:hidden" "overflow-x:hidden"

    please help

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: How to hide Horizontal scrollbar in HTML & CSS

    The overflow-x:hidden declaration is meant to hide the horizontal scrollbar regardless of window size. That was the intent because of IE's tendency to include a horizontal scrollbar even though the page content didn't necessitate it.

    A properly designed album shouldn't have images so large that they require horizontal scrolling anyway. If your album has images that large, then I wouldn't recommend using the "overflow-x:hidden" fix to hide the horizontal scrollbar.

    I came up with this fix as a quick, easy solution to implement, but it's not perfect. I'm sure there are other ways to deal with this IE horizontal scrollbar issue, and Mark has shown us one of them.

  3. #3
    Join Date
    Mar 2008
    Posts
    258

    Re: How to hide Horizontal scrollbar in HTML & CSS

    Try Making your panel 10 pix wider? This will help you to set your picture size within the text area.

    I checked the Protected properties and there's one called HScroll which, when set to false *should* make the Horizontal Scrollbar not show, even when AutoScroll is true (according to the docs).

    So, I tried it out ... I sub-classed a Panel and set HScroll to false in the constructor and used MyPanel on the form. The ScrollBar still shows up though ... but you just might want to try it yourself ... maybe I screwed something up.

    The functionality of the HScroll property can also be accomplished through calls to the GetScrollState and SetScrollState methods using ScrollStateHScrollVisible as the parameter.

  4. #4
    Join Date
    Mar 2008
    Posts
    192

    Re: How to hide Horizontal scrollbar in HTML & CSS

    The best work around I've found is to make sure all the controls are in the Client Area and then (if necessary) call PerformLayout() to force the Framework to re-evaluate the necessity of the horizontal scrollbar.

Similar Threads

  1. Scrollbar Settings
    By Bear 55 in forum Customize Desktop
    Replies: 3
    Last Post: 18-11-2010, 05:05 AM
  2. Add scrollbar to JTextArea
    By Captain Carrot in forum Software Development
    Replies: 5
    Last Post: 10-03-2010, 09:39 AM
  3. How to Add scrollbar to bottom of HTML
    By Slender in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 08:25 PM
  4. How to create scrollbar around the table in HTML
    By Ralph Lauren in forum Software Development
    Replies: 3
    Last Post: 14-05-2009, 12:51 PM
  5. How to hide the Scrollbar in Frame
    By Aamin in forum Software Development
    Replies: 3
    Last Post: 09-02-2009, 06:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,669,732.46162 seconds with 16 queries