开发者

css overflow scroll issue

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜