开发者

Adding height:100%; to elements gives me a scrollbar

开发者 https://www.devze.com 2023-01-08 01:37 出处:网络
Here\'s my html as basic as possible: <div class=\"wrapper\"> <div class=\"left\">foo</div>

Here's my html as basic as possible:

<div class="wrapper">
    <div class="left">foo</div>
    <div class="middle">foo</div>
    <div class="right">foo</div>
</div>

And here comes my css:

* { padding: 0; margin: 0; }
html, body { height: 100%; }
.wrapper { min-height: 100%; }
/* left, middle and right have float:left and a width. Also min-height:100%; */

So, I开发者_Python百科've tried everything. Added min-heigth: 100% to all, taken it away and then put it back. Still a scrollbar appears.

Any ideas?

Martti Laine


Have you tried

overflow:hidden;


Try using:

html, body, .wrapper { 
  overflow-y:hidden;
}

By the way .wrapper should be #wrapper because it is assumed to be only once on a page.

0

精彩评论

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

关注公众号