开发者

css overflow scroll issue

开发者 https://www.devze.com 2023-02-27 19:38 出处:网络
I have below div with 开发者_如何学Go <div style=\"height:900px;width:800px;overflow-x:scroll;overflow-y:hidden\">

I have below div with 开发者_如何学Go

<div style="height:900px;width:800px;overflow-x:scroll;overflow-y:hidden">
//content here

</div>

My problem is when i scroll right or left ,div border is not appearing.So it's look like cutting the data.I tried so many ways but no luck .Any help appreciated.

Thanks,

Chaitu


Set padding to your div. Like this:

<div style="height:900px;width:800px;overflow-x:scroll;overflow-y:hidden;padding:5px;">
//content here

</div>

This will ensure the inside contents remain distant from the div.


In the code you provided, you aren't giving the div a border. Try changing your code to this (adding border CSS property):

<div style="height:900px;width:800px;overflow-x:scroll;overflow-y:hidden;border:2px solid black">

    <!-- Content goes here -->
</div>

Also, like Naveed said, try adding padding (padding:5px; for example) to guarantee that your content remains within the div and doesn't flow over or get clipped.

0

精彩评论

暂无评论...
验证码 换一张
取 消