麻烦h1标签的高度,似乎是从另一个对象继承

时间:2015-05-25 00:12:00

标签: html css

我无法解释我的问题,所以这里有一个例子:

如果您检查第一个<h1>标记,您会注意到它的高度是从另一个对象继承的。我想解决这个问题......

.wrapper {
	width: 1300px;
	margin: 0 auto;
	text-align: center;
}

.feed {
	width: 950px;
	height: 800px;
	border-right: 2px solid #f0f0f0;
}

.videoContainer {
	background-color: #fafafa;
	width: 950px;
	height: 450px;
	text-align: center;
	display: inline-block;
	float: left;
}

#videoTitle {
    margin: 0;
	color: #333;
	font-size: 22px;
	font-family: Arial, sans-serif;
}
<div class="wrapper">
    <div class="content">
                <div class="feed">
                    <div class="videoContainer"><iframe width="800" height="450" src="https://www.youtube.com/embed/8GpDXV9BfLU" frameborder="0" allowfullscreen></iframe></div>
                    <h1 id="videoTitle">Something here</h1>
                    <h1 id="videoTitle">Something lorem ipsum.. To make this text a bit longer than the previous one.</h1>
                    <h1 id="videoTitle">and something short.</h1>
                </div>
    </div>
</div>

有什么想法吗?感谢。

2 个答案:

答案 0 :(得分:0)

q=[1, 2, 2, 3, 3, 4, 2, 2, 3, 1] Looking for sum 4 in values of [1, 2, 2, 3, 3, 4, 2, 2, 3, 1] with offset 0 Looking for sum 3 in values of [2, 2, 3, 3, 4, 2, 2, 3, 1] with offset 1 Looking for sum 1 in values of [2, 3, 3, 4, 2, 2, 3, 1] with offset 2 Looking for sum 0 in values of [] with offset 10 Index: Group Size 0: 1 1: 2 9: 1 Remaining q=[2, 3, 3, 4, 2, 2, 3] q=[1, 2, 3, 2, 3, 4, 2, 2, 3, 2] Looking for sum 4 in values of [1, 2, 3, 2, 3, 4, 2, 2, 3, 2] with offset 0 Looking for sum 3 in values of [2, 3, 2, 3, 4, 2, 2, 3, 2] with offset 1 Looking for sum 1 in values of [3, 2, 3, 4, 2, 2, 3, 2] with offset 2 Failed to construct sum 1 from values in [3, 2, 3, 4, 2, 2, 3, 2] Looking for sum 0 in values of [2, 3, 4, 2, 2, 3, 2] with offset 3 Index: Group Size 0: 1 2: 3 Remaining q=[2, 2, 3, 4, 2, 2, 3, 2] q=[1, 2, 2] Looking for sum 4 in values of [1, 2, 2] with offset 0 Looking for sum 3 in values of [2, 2] with offset 1 Looking for sum 1 in values of [2] with offset 2 Failed to construct sum 1 from values in [2] Looking for sum 1 in values of [] with offset 3 Failed to construct sum 1 from values in [] Failed to construct sum 3 from values in [2, 2] Looking for sum 2 in values of [2] with offset 2 Looking for sum 0 in values of [] with offset 3 Index: Group Size 1: 2 2: 2 Remaining q=[1] q=[2, 3, 3] Looking for sum 4 in values of [2, 3, 3] with offset 0 Looking for sum 2 in values of [3, 3] with offset 1 Failed to construct sum 2 from values in [3, 3] Looking for sum 1 in values of [3] with offset 2 Failed to construct sum 1 from values in [3] Looking for sum 1 in values of [] with offset 3 Failed to construct sum 1 from values in [] Failed to construct sum 4 from values in [2, 3, 3] Could not construct sum 4 from values in [2, 3, 3] 添加到clear: left;。目前,由于<h1>.videoContainer的高度为float: left;

答案 1 :(得分:0)

你想做一个clear: left;,这意味着它不再继承课程.videoContainer

#videoTitle {
  margin: 0;
  color: #333;
  font-size: 22px;
  font-family: Arial, sans-serif;
  clear: left;
}