屏幕较小时删除滚动条

时间:2016-07-25 11:13:04

标签: html css alignment

我一直试图将div(表格)对齐到中心。我更改了边距和宽度,它工作正常但是当屏幕很小时,我得到向下滚动/向右栏,如下所示:

enter image description here

我该如何改变?我尝试使用最大高度并使用边距(设置为0)但没有成功。

HTML:

<div class="container">
<div class="table">
<h3 class="table-title basic-title">####</h3>
<ul class="table-list">
<li></li>
<li></li>
</ul>
<div class="price"></div>
<a class="buy basic" href="#">MORE</a></div>
</div>

CSS:

.container {
  max-height: 465px;
}

.table {
  position: relative;
    width: 50%;
    max-width: 320px;
    min-width: 270px;
    margin: 30px auto;
  background: #fff;
  text-align: center;
  height: auto;
  margin-bottom: 90px;
  -webkit-transition: all .3s linear;
  transition: all .3s linear;
}

1 个答案:

答案 0 :(得分:1)

You can set overflow to hidden.I think this will remove your problem.

body
{
overflow:hidden;
}

Note: Try overflow.. i think its because of overflow you have been getting the problem.