Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-02-2009
Member
 
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
Reply With Quote
  #2  
Old 13-02-2009
Member
 
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.
Reply With Quote
  #3  
Old 13-02-2009
Member
 
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.
Reply With Quote
  #4  
Old 13-02-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to hide Horizontal scrollbar in HTML & CSS"
Thread Thread Starter Forum Replies Last Post
Scrollbar Settings Bear 55 Customize Desktop 3 18-11-2010 05:05 AM
Add scrollbar to JTextArea Captain Carrot Software Development 5 10-03-2010 09:39 AM
How to Add scrollbar to bottom of HTML Slender Software Development 5 22-01-2010 08:25 PM
How to create scrollbar around the table in HTML Ralph Lauren Software Development 3 14-05-2009 12:51 PM
How to hide the Scrollbar in Frame Aamin Software Development 3 09-02-2009 06:46 PM


All times are GMT +5.5. The time now is 01:23 AM.