最后是语义UI页脚

时间:2015-08-22 04:50:59

标签: html css html5 css3 semantic-ui

我在我的项目中使用Semantic-UI。我创建了一个索引页面,一切都可以正常使用元素(导航栏,页脚等)。

现在我开发了一个注册页面,但页脚没有进入页面的末尾,我该怎么办?

页脚代码:

<div class="ui inverted vertical footer segment">
    <div class="ui container">
        Travel Match 2015. All Rights Reserved
    </div>
</div>

注意:我在页脚中没有任何css规则,只有那些由semantic-ui添加的规则

更新 导航条代码:

<div class="ui inverted segment">
    <div class="ui container">
        <div class="ui inverted secondary menu">
            <div class="item">
                <i class="plane icon app-icon"></i>
            </div>
                <div class="right item">
                  <a href="/signup">Signup</a>
                </div>
        </div>
    </div>
</div>

表单代码:

    <form class="ui large form container">
        <div class="ui stacked segment">
            <div class="field">
                <div class="ui left icon input">
                    <i class="user icon"></i>
                    <input type="text" name="email" placeholder="E-mail address">
                </div>
            </div>
            <div class="field">
                <div class="ui left icon input">
                    <i class="lock icon"></i>
                    <input type="password" name="password" placeholder="Password">
                </div>
            </div>
            <div class="ui fluid large teal submit button">Login</div>
        </div>
        <div class="ui error message"></div>
    </form>
    <div class="striped"></div>

1 个答案:

答案 0 :(得分:17)

您可以尝试absolute定位,因为您的内容小于Semantic-ui docs中的部分。

使用min-height来应用CSS规则,因为页脚位于特定高度范围的底部,从而避免与内容重叠。

&#13;
&#13;
@media (min-height: 320px) {
  .ui.footer.form-page { /* Increased specificity for SO snippet priority */
    position: absolute;
    bottom: 0;
    width: 100%;
  }
}
&#13;
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.0.8/semantic.min.css" rel="stylesheet" />
<div class="wrapper">
  <div class="ui inverted segment">
    <div class="ui container">
      <div class="ui inverted secondary menu">
        <div class="item">
          <i class="plane icon app-icon"></i>
        </div>
        <div class="right item">
          <a href="/signup">Signup</a>
        </div>
      </div>
    </div>
  </div>

  <form class="ui large form container">
    <div class="ui stacked segment">
      <div class="field">
        <div class="ui left icon input">
          <i class="user icon"></i>
          <input type="text" name="email" placeholder="E-mail address">
        </div>
      </div>
      <div class="field">
        <div class="ui left icon input">
          <i class="lock icon"></i>
          <input type="password" name="password" placeholder="Password">
        </div>
      </div>
      <div class="ui fluid large teal submit button">Login</div>
    </div>
    <div class="ui error message"></div>
  </form>
  <div class="striped"></div>
</div>
<div class="ui inverted vertical footer segment form-page">
  <div class="ui container">
    Travel Match 2015. All Rights Reserved
  </div>
</div>
&#13;
&#13;
&#13;