初学者html / css:当我评论通用边框时,为什么我的网页会扭曲?

时间:2017-03-16 20:02:52

标签: html css

我现在只是在玩HTML / CSS,目前我的目标是将我的桌子移动到页面的顶部中心。当我打开通用边框时,我可以将它移动到我想要它的位置,但是一旦我发表评论,桌子就会跳到其他地方!



Sub RowFinder()
    Dim sheet1Data As Variant

    With Worksheets("Sht2") '<--| reference your worksheet 2
        sheet1Data = Application.Transpose(.Range("A1", .Cells(.Rows.count, 1).End(xlUp)).Value)
    End With
    With Worksheets("Sht1") '<--| reference your worksheet 1
        With .Range("A1", .Cells(.Rows.count, "A").End(xlUp)) '<--| reference its column A cells from row 1 (header) down to last not empty one
            .AutoFilter field:=1, Criteria1:=sheet1Data, Operator:=xlFilterValues '<--| filter cells with sheet 2 column A values
            If Application.WorksheetFunction.Subtotal(103, .Cells) > 1 Then Intersect(.Parent.UsedRange, .Resize(.Rows.count - 1).Offset(1).SpecialCells(xlCellTypeVisible).EntireRow).Copy Destination:=Worksheets("Sht3").Range("A1")
        End With
        .AutoFilterMode = False
    End With
End Sub
&#13;
body {
  background-image: url("https://images.freecreatives.com/wp-content/uploads/2016/04/Triangle-Shiny-Modern-Background-.jpg");
  background-repeat: no-repeat;
  background-size: cover;
}

* {
  border: 2px solid black;
}

* #move {
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.profile {
  font-family: Verdana, Arial, serif;
  font-size: 20px;
  width: 15%;
  float: left;
}

iframe {
  float: right;
  width: 30%;
  height: 1%;
  margin-right: 10px;
}

form {
  clear: left;
}

#nav ul {
  text-align: center;
  margin: auto;
  position: relative;
}

#nav li {
  position: relative;
  display: inline-block;
  border: 1px solid black;
  border-radius: 2px;
  background-color: white;
  padding: 5px;
  font-family: Cursive;
}

#times table {
  width: 10%;
  height: 10%;
  margin-top: -600px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}


/*table {
    		margin-left:auto;
    		margin-right:auto;
    	}*/

td {
  border: 1px solid black;
}
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

那是因为你给每个元素边框,这些边框会产生额外的空间,并会推动其他元素。除非您实际上计划在所有内容上使用边框,否则最好的选择是调整margin的{​​{1}}值,仅使用将要使用的边框,或者根本不调整。{/ p >

如果您评论/删除边框,则可以将table的否定#times table调整为类似margin-top的内容,这样可以使表格与设置所有边框时非常相似。“ p>

没有边框:

enter image description here

使用边框:

enter image description here

避免负利润率的替代方案:

  • 使用550px使position: absolute;独立于其他元素流,并调整table&amp; top值得您的利益:

示例:

enter image description here