开发者

Hide browser scrollbars

开发者 https://www.devze.com 2023-01-08 11:58 出处:网络
If I have two DIV\'s on my webpage which are larger than a browser window, than I have a horizontal scrollbar in my browser.

If I have two DIV's on my webpage which are larger than a browser window, than I have a horizontal scrollbar in my browser.

What should I do to hide this browser scrollbar for the first DIV and not to hide for a second?

Like I have two divs: 200px and 300px width. I want开发者_高级运维 to hide horizontal scrollbar if my browsersize 201-299 px. 250px for example.

How could I ban scroll the browser window if the width 201-299?


You could wrap the two <div>s in a wrapper <div> with min-width set to something acceptable to you:

<style>
div.wrapper {
  min-width: 300px;
}

div.content {
 width: 250px;
}
</style>

<div class="wrapper">
  <div class="content>
  ...
  </div>
  <div class="content>
  ...
  </div>
</div>

This way, the browser will show scrollbars for the wrapper div, but not on the content divs. Is that what you are looking for?

0

精彩评论

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