【问题标题】:how can i remove the margin on top form如何删除顶部表单上的边距
【发布时间】:2019-04-18 23:44:27
【问题描述】:

我想删除表单顶部的边距,使其与左侧的文本具有相同的边距。

这是我的代码:

<div class="secound-top container">

  <div class="row">

    <div class="col-md-5 col-sm-5 col-xs-12 col-xl-12">

  <h4 class="title"> Plain Page</h4>

    <form>

      <div class="input-group">

        <input class="search-text" type="text" name="name" placeholder="search for....">

          <button class="btn btn-default" type="submit"><i>Go</i></button>

          </div>

    </form>

</div>

image

【问题讨论】:

  • 删除 bootstrap 3 或 4 标签。还要在代码 sn-p 中添加更多 CSS,因为我怀疑这会显示问题
  • 我发现很难添加 css 代码

标签: html css twitter-bootstrap-3 bootstrap-4


【解决方案1】:

将其插入到您的 CSS 文件或样式标签中:

body{
    margin-top: 0px; 
    }

【讨论】:

    【解决方案2】:

    我已经解决了这个错误,我将表单标签放在一个容器 div 上,然后用负边距顶部,表单上升了:

    有代码:

    <div class="container-fluid form">
    
        <form>
    
    
    
            <input class="search-text" type="text" name="name" placeholder="search 
             for....">
    
              <button class="btn btn-default" type="submit"><i>Go</i></button>
    
              </div>
    
               CSS
               .form{
              margin-top: -30px;
              }
    

    【讨论】:

      猜你喜欢
      • 2022-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-15
      • 1970-01-01
      • 2015-04-24
      • 2012-01-17
      相关资源
      最近更新 更多