Html 为什么最后会有锯齿?如何修复CSS样式

Html 为什么最后会有锯齿?如何修复CSS样式,html,css,layout,Html,Css,Layout,这是我的样式表,有几个问题,但最紧迫的是右端边缘的锯齿 从JSFIDLE中可以看出,内容背景色的右侧直到边界才完全覆盖整个空间。什么原因? 这是我的CSS。我需要把表格放在这一页上,这是必须的。这两个表都是必需的 html, body { min-width :100%; min-height:100%; padding:0; margin:0; } #wrapper { position:absolute; top:0; bottom:0

这是我的样式表,有几个问题,但最紧迫的是右端边缘的锯齿

从JSFIDLE中可以看出,内容背景色的右侧直到边界才完全覆盖整个空间。什么原因? 这是我的CSS。我需要把表格放在这一页上,这是必须的。这两个表都是必需的

html, body {
    min-width :100%;
    min-height:100%;
    padding:0;
    margin:0;
}
#wrapper {
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    margin : 0.3em;
    border-style : solid;
    border-width : 0.18em;
    border-color : black;
    overflow-x : scroll;
}
.table {
    display:table;
    width:100%;
    height:100%;
}
.row {
    display:table-row;
}
.cell {
    display:table-cell;
}
.middle {
    background-color:green;
    height:100%;
}
.middle.row{
  overflow-x: auto; 
  overflow-y: hidden;
}
.bottom {
    background-color:rgba(30, 30, 30, 0.85);
    color : #FFF;
}
.top {
    background-color:pink;
}
.left {
    width:20%;
    background:#FFD540;
    height:100%;
}
.right {
    width: 78%;
    background:#E4E4E4;
    height:100%;
}

.top.row {
   height : 3%;
   width : 100%;
   margin : 2em;
   background-color : #F6F6F6;
}
.bottom.row {
   height : 20%;
   width : 100%;
   text-align :center;
}
.row > .cell{
  width : 100%;
}
.cell > #logo {
  position : relative;
  width : 22%;
  float : left;
  margin-left : 10px;
  margin-top : 15px;

}

.cell > #heading {
   width : 75%;
   text-align : center;
   float : left;
}
.banner {
    font-weight: bold;
    font-size: 2vw;
    color: black;
    font-family : Raleway;
    line-height: 0.9;
}
img {
  max-width : 100%;
  height : auto;
  margin-left: auto;
  margin-right: auto;
}


#data-table tr : first-child {
    background-color : lightgrey;
}
#top-table tr:first-child{
     background-color : lightgrey;
}
.tableInPage{
  overflow: auto;
}
#top-table {
   margin-top : 20px;
   margin-left : 10px;
}
#data-table {
   margin-top : 20px;
   margin-left : 10px;
}

#user-div {
   float : left;
   width : 22%;
   font-family : Raleway;
}
#acc-type-heading {
   float : left;
   width: 75%;
   font-family : Raleway;
}

.upper  {
   background-color:rgba(30, 30, 30, 0.85);
    color : #FFF;
    height :
}
table { 
  width: 100%; 
  border-collapse: collapse; 
}

#data-table tr:nth-of-type(odd) { 
  background: lightblue; 
}
th { 
  background: #333; 
  color: white; 
  font-weight: bold; 
}
td, th { 
  padding: 6px; 
  border: 1px solid #ccc; 
  text-align: left; 
}
#data-table-container{
   width : 1260px!important;
   overflow-x : scroll;
}
.menu-items {
  margin-left : 25px;
  margin-top : 70px;
  min-width: 200px;
} 

是什么原因导致了这种情况,以及如何修复这种情况?

因为在CSS代码中,您必须删除这两者的左边距:

#top-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}
#data-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}

如果删除左边距,您将看到背景是我认为您想要的。

因为在CSS代码中,您必须同时删除这两个元素的左边距:

#top-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}
#data-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}

如果删除左边距,您将看到背景是我认为您想要的。

因为在CSS代码中,您必须同时删除这两个元素的左边距:

#top-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}
#data-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}

如果删除左边距,您将看到背景是我认为您想要的。

因为在CSS代码中,您必须同时删除这两个元素的左边距:

#top-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}
#data-table {
    margin-top : 20px;
    /*margin-left : 10px;*/
}
如果你去掉左边的空白,你会看到背景是我认为你想要的。

这可能会对你有所帮助。不要在表上使用
margin
,而是将其删除,并在包含两个表的父元素上使用
padding
,这可能会对您有所帮助。不要在表上使用
margin
,而是将其删除,并在包含两个表的父元素上使用
padding
,这可能会对您有所帮助。不要在表上使用
margin
,而是将其删除,并在包含两个表的父元素上使用
padding
,这可能会对您有所帮助。不要在表上使用
边距
,而是将其移除,并在包含两个表的父元素上使用
填充
元素被
数据表
顶部表
css规则中的
边距左:10px
推压10px。这可以通过以下方式解决:

#data-table, #top-table {
  margin-top: 20px;
  margin-left: 0px; 
}
或者,如果你想保留左边距,只需给每一个偶数行
背景颜色:灰色带有

#data-table tr  {
  background-color : lightgrey;
}
#top-table tr{
  background-color : lightgrey;
}
元素被
数据表和
顶部表中的
左边距:10px
css规则推压10px。这可以通过以下方式解决:

#data-table, #top-table {
  margin-top: 20px;
  margin-left: 0px; 
}
或者,如果你想保留左边距,只需给每一个偶数行
背景颜色:灰色带有

#data-table tr  {
  background-color : lightgrey;
}
#top-table tr{
  background-color : lightgrey;
}
元素被
数据表和
顶部表中的
左边距:10px
css规则推压10px。这可以通过以下方式解决:

#data-table, #top-table {
  margin-top: 20px;
  margin-left: 0px; 
}
或者,如果你想保留左边距,只需给每一个偶数行
背景颜色:灰色带有

#data-table tr  {
  background-color : lightgrey;
}
#top-table tr{
  background-color : lightgrey;
}
元素被
数据表和
顶部表中的
左边距:10px
css规则推压10px。这可以通过以下方式解决:

#data-table, #top-table {
  margin-top: 20px;
  margin-left: 0px; 
}
或者,如果你想保留左边距,只需给每一个偶数行
背景颜色:灰色带有

#data-table tr  {
  background-color : lightgrey;
}
#top-table tr{
  background-color : lightgrey;
}

要么这样,要么改变偶数tr元素的样式,就像改变奇数tr元素的样式一样。这不是白色的行的实际背景。要么这样,要么你改变偶数tr元素的样式,就像你改变奇数tr元素的样式一样。这不是白色的行的实际背景。要么这样,要么你改变偶数tr元素的样式,就像你改变奇数tr元素的样式一样。这不是白色的行的实际背景。要么这样,要么你改变偶数tr元素的样式,就像你改变奇数tr元素的样式一样。这不是白色的行的实际背景。在div父级和任何子级之间分配空间的更好方法+1在div父级和任何子级之间分配空间的更好方法+1在div父级和任何子级之间分配空间的更好方法+1在div父级和任何子级之间分配空间的更好方法+1.