Results 1 to 4 of 4

Thread: Textarea scrollbar doesn't disappear despite width:0

  1. #1
    Join Date
    Nov 2009
    Location
    Isfahan, Iran
    Posts
    229
    Thanks
    46
    Thanked 1 Time in 1 Post

    Default Textarea scrollbar doesn't disappear despite width:0

    No scrollbar in Chrome, but in Firefox and IE, it doesn't disappear although the element width is 0:
    DEMO

    What's the reason? What's a cross-browser solution so the textarea behaves like in Chrome?
    Last edited by Rain Lover; 04-26-2014 at 08:23 AM.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Browsers behave differently but this looks like a solution (haven't tried - on iPhone) http://stackoverflow.com/questions/1...-from-textarea
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Nov 2009
    Location
    Isfahan, Iran
    Posts
    229
    Thanks
    46
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by Beverleyh View Post
    Browsers behave differently but this looks like a solution (haven't tried - on iPhone) http://stackoverflow.com/questions/1...-from-textarea
    Adding overflow:hidden; completely removes the scrollbar and scrolling feature even if you change the width size value to something larger. As I said it should behave like in Chrome.

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Adding overflow:hidden; completely removes the scrollbar and scrolling feature
    Yes I'm aware of that. I'm not sure why you specifically highlighted the overflow:hidden part though? How about the other 2 noted css properties? I was think more of overflow:auto (or overflow-y:auto) so the scrollbar only appears when the contents exceed the field size? I can't test as I'm on iPhone at the moment but how do they fair?

    It might just be one of those things though - like I said, browsers behave differently and there are some things that you can't force them to do no matter how much you'd like.

    That being said, there may be a JavaScript solution but I'm not sure that its a good idea to interfere with the default behaviour of a browser
    Last edited by Beverleyh; 04-26-2014 at 09:25 AM.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. Replies: 6
    Last Post: 12-29-2009, 08:42 PM
  2. Flexcroll - Set width of scrollbar
    By MCrosbie in forum JavaScript
    Replies: 0
    Last Post: 11-29-2009, 09:27 PM
  3. Replies: 6
    Last Post: 04-20-2009, 03:30 PM
  4. Replies: 4
    Last Post: 11-03-2008, 10:51 PM
  5. Width, Height doesn't work
    By elaine1959 in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 10-30-2006, 07:49 AM

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
  •