3

See this code :

html{position:relative;min-height:100%;}

and

<div style="width:100%;height:100%;overflow:auto;">
    <div id="main" style="width:200px;max-height:100px;">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </div>
</div>

In addition, Textarea scrollbar and resize grabber cannot hiding too.

How can I fix it using CSS?

in Chrome(MacOS). But Safari works well.

This code is example for quick understanding.

The contents are large enough to require scrollbar.

UPDATE : https://jsfiddle.net/xu3q4m4w/9/

I guess This problem is relates to LINK.

5
  • why don't you set overflow:hidden; Commented Feb 4, 2016 at 6:55
  • I think it better if you use the max-width + width with large content to make it responsive as I mentioned in my answer. Never use width:1500px in this case Commented Feb 4, 2016 at 7:03
  • My problem is auto hide not working. Commented Feb 4, 2016 at 7:05
  • pls explain me how auto hide do you expect? :D Commented Feb 4, 2016 at 7:42
  • I think scrollbar shown by hover event before. not always Commented Feb 4, 2016 at 7:47

3 Answers 3

2

height set into 100% create scroll bar. Try to fix into max-height:100%.
as well as width. you should set into width:100% or max-width:100% to get full width, not in pixel.

UPDATED:

<div style="width:100%;height:100%;overflow:auto;">
    <div id="main" style="max-width:1500px;height:200px;">

    </div>
</div>

jsfiddle

Sign up to request clarification or add additional context in comments.

Comments

1

I figure out this problem. It Happen by only old chrome version (48.0.2564.97)

Now fix it. (48.0.2564.103 )

Thank you for answer.

Comments

0

use this fiddle overflow-x:hidden

<div style="width:100%;height:100%;overflow:auto;overflow-x:hidden;">
    <div id="main" style="width:1500px;height:200px;">

    </div>
</div>

Link

1 Comment

content should be shown. overflow-x:hidden is incorrect way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.