在布尔玛两种形式之间的巨大差距

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在布尔玛两种形式之间的巨大差距相关的知识,希望对你有一定的参考价值。

我有一个布尔玛CSS形式,我想消除两种形式之间的差距。有没有一种办法,这布尔玛CSS都不可能不添加自定义CSS进行修改。

<section class="section">
  <div class="container">
    <form class="control">
      <div class="columns is-multiline">
        <div class="column is-2">
          <div class="box">
            <h1 class="subtitle">Form Part 1</h1>
            <div class="field">
              <label class="label">col1</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col1">
                <i class="fas fa-dollar-sign"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col2</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col2 ">
                <i class="fas fa-percentage"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col3</label>
              <div class="control">
                <div class="select is-fullwidth">
                  <select>
                    <option>drop1</option>
                    <option>drop2</option>
                  </select>
                </div>
              </div>
            </div>
            <div class="field">
              <label class="label">col3</label>
              <div class="control">
                <div class="select is-fullwidth">
                  <select>
                    <option>a</option>
                    <option>b</option>
                    <option>c</option>
                  </select>
                </div>
              </div>
            </div>
            <a class="button is-primary">Next</a>
          </div>
        </div>
        <div class="column is-10">
          <div class="box">
            <h1 class="subtitle">form2</h1>
            <div class="columns ">
              <div class="column is-2">
                <div class="field">
                  <label class="label">col1</label>
                  <div class="control">
                    <input class="input" type="text" placeholder="col1">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col2</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col2">
                    <i class="fas fa-dollar-sign"></i>
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col3</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col3">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col4</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col4">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col5</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col5">
                  </div>
                </div>
              </div>
            </div>
            <a class="button is-primary">Next</a>
          </div>
        </div>
        <div class="column is-10 is-offset-2">
          <div class="box">
            <h1 class="subtitle">form3</h1>
            <div class="columns">
              <div class="column is-3">
                <div class="field">
                  <label class="label">col1</label>
                  <div class="control">
                    <input class="input" type="text" placeholder="col1">
                  </div>
                </div>
              </div>
              <div class="column is-1">
                <div class="field">
                  <label class="label">col2 </label>
                  <div class="control">
                    <input class="input" type="text" placeholder="col2">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col3 </label>
                  <div class="control">
                    <input class="input" type="text" placeholder="col3">
                  </div>
                </div>
              </div>
            </div>
            <a class="button is-primary">Next</a>
          </div>
        </div>
      </div>
    </form>
  </div>
</section>

当您发布在https://codepen.io/JMSmith/pen/yZKxOp验证码

你会发现有窗体2和Form3之间的巨大差距。

我的问题是我如何消除这个差距?

我是新来的布尔玛和CSS新手还是。

答案

enter image description hereTake看看我的笔。 2个改变:主要问题是包装的第二和第三形式都在一列,所以左侧是它自己的列,然后在右侧包含了其他两种形式。

然后,你需要从上面form3的offset-2删除col-is-10类,因为这整个右列是只有10宽。

https://codepen.io/DanOswalt/pen/qgoMNv?editors=1000

<section class="section">
  <div class="container">
    <form class="control">
      <div class="columns is-multiline">
        <div class="column is-2">
          <div class="box">
            <h1 class="subtitle">Form Part 1</h1>
            <div class="field">
              <label class="label">col1</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col1">
                <i class="fas fa-dollar-sign"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col2</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col2 ">
                <i class="fas fa-percentage"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col3</label>
              <div class="control">
                <div class="select is-fullwidth">
                  <select>
                    <option>drop1</option>
                    <option>drop2</option>
                  </select>
                </div>
              </div>
            </div>
            <div class="field">
              <label class="label">col3</label>
              <div class="control">
                <div class="select is-fullwidth">
                  <select>
                    <option>a</option>
                    <option>b</option>
                    <option>c</option>
                  </select>
                </div>
              </div>
            </div>
            <a class="button is-primary">Next</a>
          </div>
        </div>
        <div class="column is-10">
          <div class="box">
            <h1 class="subtitle">form2</h1>
            <div class="columns ">
              <div class="column is-2">
                <div class="field">
                  <label class="label">col1</label>
                  <div class="control">
                    <input class="input" type="text" placeholder="col1">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col2</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col2">
                    <i class="fas fa-dollar-sign"></i>
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col3</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col3">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col4</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col4">
                  </div>
                </div>
              </div>
              <div class="column is-2">
                <div class="field">
                  <label class="label">col5</label>
                  <div class="control has-icons-right">
                    <input class="input" type="text" placeholder="col5">
                  </div>
                </div>
              </div>
            </div>
            <a class="button is-primary">Next</a>
          </div>


          <div class="column is-10">
            <div class="box">
              <h1 class="subtitle">form3</h1>
              <div class="columns">
                <div class="column is-3">
                  <div class="field">
                    <label class="label">col1</label>
                    <div class="control">
                      <input class="input" type="text" placeholder="col1">
                    </div>
                  </div>
                </div>
                <div class="column is-1">
                  <div class="field">
                    <label class="label">col2 </label>
                    <div class="control">
                      <input class="input" type="text" placeholder="col2">
                    </div>
                  </div>
                </div>
                <div class="column is-2">
                  <div class="field">
                    <label class="label">col3 </label>
                    <div class="control">
                      <input class="input" type="text" placeholder="col3">
                    </div>
                  </div>
                </div>
              </div>
              <a class="button is-primary">Next</a>
            </div>
        </div>
      </div>
    </form>
      </div>
  </div>
</section>
另一答案

可以在管线96中删除,然后在线路97中删除被偏移-2,这将是下面的代码我帮助修改。

希望它可以帮助你。

  <section class="section">
      <div class="container">
        <form class="control">
          <div class="columns is-multiline">
            <div class="column is-2">
              <div class="box">
            <h1 class="subtitle">Form Part 1</h1>
            <div class="field">
              <label class="label">col1</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col1">
                <i class="fas fa-dollar-sign"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col2</label>
              <div class="control has-icons-right">
                <input class="input" type="text" placeholder="col2 ">
                <i class="fas fa-percentage"></i>
              </div>
            </div>
            <div class="field">
              <label class="label">col3</label>
              <div class="control">
                <div class="select is-fullwidth">
                  <select>
                    <option>drop1</option>
                    <option>drop2</option>
                  </select>
                </div>
              </div>
            </div>
            <div class="field">
              &

以上是关于在布尔玛两种形式之间的巨大差距的主要内容,如果未能解决你的问题,请参考以下文章

std::vector 如何访问它们之间存在巨大差距的元素?

缩略图轮播,主滑块和缩略图之间的巨大差距

猿创征文|为了学习英语,我开发了一个单词对战系统

猿创征文|为了学习英语,我开发了一个单词对战系统

猿创征文|为了学习英语,我开发了一个单词对战系统

如何在活动和浏览器片段之间传递值? [复制]