li 元素上方不需要的空格
Unwanted whitespace above li element
每个 li 元素上方都有空格,我不知道是什么原因造成的。我试过玩边距和填充,但似乎没有任何效果。我希望每列的顶部对齐。
这是正在发生的事情的图片。我希望每列的顶部对齐。
这里是 link 页面 link
#episodes {
width: 100%;
background: #ffffff;
padding-top: 200px;
padding-bottom: 50px;
}
.episode img {
width: 100%;
}
.episode {
width: 300px;
position: relative;
}
#episodes ul{
width: 100%;
margin: 0;
padding: 0;
list-style-type: none;
font-size: 0;
}
#episodes li {
width: 300px;
display: inline-block;
margin: 10px;
}
.caption {
height: 500px;
background: #e6e6e6;
}
.caption h1 {
width: 100%;
font-family: futura-pt, sans-serif;
font-weight: bold;
font-size: 18px;
color: #061838;
margin-top: 0;
margin-bottom: 0;
padding: 10px;
}
.caption p {
font-family: museo-slab, serif;
font-weight: 300;
font-style: normal;
font-size: 12px;
hyphens: none;
margin-top: 0;
padding: 10px;
}
.date {
position: absolute;
bottom: 0;
}
试试下面的代码,它应该适合你
#episodes ul {
content: "";
display: table;
clear: both;
}
#episodes li {
float: left;
}
每个 li 元素上方都有空格,我不知道是什么原因造成的。我试过玩边距和填充,但似乎没有任何效果。我希望每列的顶部对齐。
这是正在发生的事情的图片。我希望每列的顶部对齐。
这里是 link 页面 link
#episodes {
width: 100%;
background: #ffffff;
padding-top: 200px;
padding-bottom: 50px;
}
.episode img {
width: 100%;
}
.episode {
width: 300px;
position: relative;
}
#episodes ul{
width: 100%;
margin: 0;
padding: 0;
list-style-type: none;
font-size: 0;
}
#episodes li {
width: 300px;
display: inline-block;
margin: 10px;
}
.caption {
height: 500px;
background: #e6e6e6;
}
.caption h1 {
width: 100%;
font-family: futura-pt, sans-serif;
font-weight: bold;
font-size: 18px;
color: #061838;
margin-top: 0;
margin-bottom: 0;
padding: 10px;
}
.caption p {
font-family: museo-slab, serif;
font-weight: 300;
font-style: normal;
font-size: 12px;
hyphens: none;
margin-top: 0;
padding: 10px;
}
.date {
position: absolute;
bottom: 0;
}
试试下面的代码,它应该适合你
#episodes ul {
content: "";
display: table;
clear: both;
}
#episodes li {
float: left;
}