无处不在的高度

时间:2017-01-18 17:59:15

标签: html css

不知何故,图片上相同块元素中的一个块会产生莫名其妙的高度。图片上显示的样式并不表示此元素的行为。事实上,height甚至没有为那些h3设置<section class="about-us"> <div class="wrapper clearfix"> <h2 class="about-us-heading section-heading red-black-stressing-line-at-left">About Us</h2> <p class="about-us-statement section-saying about-us-saying">This is who we are - or at least who we strive to be...</p> <div class="about-more"> <p class="about-saying">If you can't explain it simply, you don't understand it enough.</p> <a href="#" class="about-more-link">The more you know</a> </div> <div class="about-work-details"> <h3 class="about-details-heading typography-icon">Typography</h3> <p class="about-details-text">...</p> </div> <div class="about-work-details"> <h3 class="about-details-heading curve-with-dots-icon">Full icon set</h3> <p class="about-details-text">...</p> </div> <div class="about-work-details"> <h3 class="about-details-heading triangular-ruler-icon">Accurate</h3> <p class="about-details-text">...</p> </div> </div> </section> Browser screenshot

html是

.about-us{
   background-color: #fff;
   position: relative;
}

.about-us-heading{
  color: #272d32;
}

.about-us-statement{
  color: #4e5860;
  margin-bottom: 3.9em;
}

.about-more{
  width: 16.875em;
  float:left;
  margin-right: 1.875em;
}

.about-saying{
  font-family: "Open Sans", sans-serif;
  font-size: 1.75em;
  line-height: 1.4285;
  color: #4e5860;
}

.about-more-link{
  display: inline-block;
  font-family: "Raleway", sans-serif;
  line-height: .77;
  padding: 1em 2.625em 1em 1.25em;
  text-decoration: none;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  background: #ff3c1f url(../images/left-arrow.gif) 12.7em .95em no-repeat;
  margin-top: 4.25em;
  transition: background-color 0.5s;
}

.about-work-details{
  width: 16.875em;
  float:left;
  margin-right: 1.685em;
  margin-bottom: 8.1875em;
  position: relative;
  min-height: 16.875em;
  border: 1px solid #edeff2;
}

.about-work-details:last-of-type{
  margin-right: 0;
}

.about-details-heading{
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 1.25em;
  color: #303030;
  text-transform: uppercase;
  padding: 0.85em 0 1em 3em;
  margin: 1.70em 0 0 1em;
}

三个相同的div.about-work-details元素。

默认的css是

@media screen and (max-width: 860px){

  .about-work-details{
    width: 70%;
    margin: 3em auto;
    min-height: 0;
    float: none;
  }

  .about-us{
    padding-bottom: 1px;
  }

  .about-work-details:last-of-type {
    margin-right: auto;
  }

}

媒体查询修改

Sub report()

Sheet4.Activate

Dim finalrow As Integer

Dim i As Integer

Sheet25.Range("A5:G500").ClearContents

project1 = Sheet4.Range("U1").Value
project2 = Sheet4.Range("U2").Value
project3 = Sheet4.Range("U3").Value
project4 = Sheet4.Range("U4").Value
project5 = Sheet4.Range("U5").Value
project6 = Sheet4.Range("U6").Value
project7 = Sheet4.Range("U7").Value
project8 = Sheet4.Range("U8").Value
project9 = Sheet4.Range("U9").Value
project10 = Sheet4.Range("U10").Value
project11 = Sheet4.Range("U11").Value
project12 = Sheet4.Range("U12").Value
project13 = Sheet4.Range("U13").Value
project14 = Sheet4.Range("U14").Value
project15 = Sheet4.Range("U15").Value


finalrow = Sheet4.Range("A2000").End(xlUp).Row


'-----------------------1---------------------'

i = 0
Sheet4.Range("U1").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


For i = 1 To finalrow
     If Cells(i, 1) = project1 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'2

finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U2").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project2 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A10000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i




'3
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U3").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project3 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'4
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U4").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project4 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'5
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U5").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project5 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'6
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U6").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project6 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'7
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U7").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project7 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'8
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U8").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project8 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'9
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U9").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project9 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'10
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U10").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project10 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'11
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U11").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project11 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'12
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U12").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project12 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'13
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U13").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project13 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'14
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U14").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project14 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i



'15
finalrow = Sheet4.Range("A2000").End(xlUp).Row

i = 0

Sheet4.Range("U15").Copy
Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme

For i = 1 To finalrow
     If Cells(i, 1) = project15 Then
           Sheet4.Range(Sheet4.Cells(i, 2), Sheet4.Cells(i, 8)).Copy
            Sheet25.Range("A1000").End(xlUp).Offset(1, 0).PasteSpecial xlPasteAllUsingSourceTheme


    End If

Next i


Sheet25.Activate

End Sub

1 个答案:

答案 0 :(得分:0)

似乎是浮动项目行为问题。

  • 尝试从float:left;删除/评论.about-more