与css有点奇怪

时间:2016-04-08 10:00:46

标签: html css html5 css3

请查看此site

你可以在大图中看到三个文本:

  • 的text1
  • text2的
  • 文字3

有人可以告诉我为什么 text2 135px height

CODE

<div class="into-txt">

    <div>text1</div>
    <div>text2</div>
    <div>text3</div>

</div>

.into-txt{
    position: relative;
    top: 214px;
    font-size: 35px;
    font-family: "almoni-400";
    color: #ffffff;
}

2 个答案:

答案 0 :(得分:1)

因为你正在浮动你需要清除的nav,否则它将不再流动。

因为您使用的是Bootstrap,所以只需在<div class="clearfix"></div>之后和nav之前添加.intro-txt

答案 1 :(得分:0)

使用margin-top: 214px;代替top:214px

.into-txt {
    position: relative;
    font-size: 35px;
    font-family: "almoni-400";
    color: #ffffff;
    margin-top: 214px;
}

其他解决方案如果可以,请在<div class="clearfix"></div> div之前添加此.into-txt或从float:right删除{c}中的.main-navigation