html - 如何使用 Bootstrap 中的按钮移至页面底部

标签 html css twitter-bootstrap

我试图在页面顶部添加按钮,并在底部添加一个表单,当我单击按钮时,它应该在同一页面上的表单位置下降。我不知道如何才能做到这一点。

这是我的按钮代码

 <div class="col-xs-12 col-sm-2">
                     <p style="padding:40px;"></p>
                <button class="btn btn-block btn-warning">Reserve Table</button>
                </div>

这是我的表单代码

<div class="col-xs-6 col-sm-3">
                <div class="form-vertical" role="form">
                      <p style="padding:10px;"></p>
                    <h3>Table Reservation</h3>
             </div>
        </div>
          <div class="col-xs-6 col-sm-9">
                <div class="form-horizontal" role="form">
                      <div class="form-group">
                <label for="Number" class="col-sm-2 control-label">Number of people</label>  
                   <label class="radio-inline">
                       <input type="radio" name="optradio">1
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="optradio">2
                    </label>
                <label class="radio-inline">
                    <input type="radio" name="optradio">3
                </label>
                           <label class="radio-inline">
                    <input type="radio" name="optradio">4
                </label>
                           <label class="radio-inline">
                    <input type="radio" name="optradio">5
                </label>
                           <label class="radio-inline">
                    <input type="radio" name="optradio">6
                </label>
                    </div>
                <div class="form-group has-feedback">
                 <label for="Date-time" class="col-sm-2 control-label">Date &amp; Time</label>  
                    <div class="col-sm-3">
          
                <input type="text" class="form-control pull-left" name="Date-time" placeholder="date">
                          <i class="glyphicon glyphicon-calendar form-control-feedback"></i>
                        </div>
                        
                     <div class="form-group  has-feedback">
                 
                              <div class="col-sm-3">
                <input type="text" class="form-control"  placeholder="time">
                          <i class="glyphicon glyphicon-time form-control-feedback"></i>
                        </div>
                        </div>
                    <div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  Please <strong ><a href="tel:81343444" style="color:black">call</a></strong> for bookinng of more than 6 people.
</div>
                    </div>
             </div>

请告诉我该怎么做?

最佳答案

你好@lomesh shah,这很简单。

步骤 1

首先给该表单一个id,例如

<form id="testform"> rest of the code goes here </form>

步骤 2

您必须使用 anchor 标记而不是按钮,但通过在其上使用 bootstrap 的 btn 类,您可以给它一个按钮外观,然后在 href 内使用表单的 id,单击它将带您进入表单。请参阅下面的代码

<a href="#testform" class="btn btn-block btn-warning">Go to form</a>

困惑?回击我:)我会回复

关于html - 如何使用 Bootstrap 中的按钮移至页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36971381/

相关文章:

html - 我应该如何将图像放在侧边栏菜单下方

javascript - 单击 1 个按钮时同时加载 2 个不同 div 中的 2 个页面

html - 如何更改 bootstrap 4 上的导航栏悬停颜色?

html - Bootstrap Fixed Header 元素不会出现在移动设备上

twitter-bootstrap - 单击 Bootstrap 4 折叠时旋转 SVG 图像

html - 背景封面无法正常工作

html - 为什么在Ubuntu18.04中html的默认打开方式设置为Visual Studio Code URL Handler

html - 向右包裹一个列表

javascript - 一个html中有很多div

css - Wordpress 自定义 CSS 不适用于特定的类组