Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Chrome : Cannot hide scrollbar automatically

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.

like image 238
Amuzr Avatar asked Jun 09 '26 12:06

Amuzr


2 Answers

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

like image 60
Joe Kdw Avatar answered Jun 12 '26 03:06

Joe Kdw


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.

like image 23
Amuzr Avatar answered Jun 12 '26 03:06

Amuzr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!