【问题标题】:How do I fix my navbar in bootstrap vue to be in centre?如何将引导 vue 中的导航栏固定在中心?
【发布时间】:2020-07-04 06:34:45
【问题描述】:

如何将导航栏组件放在中心?这是我第一次这样做,我大部分都没问题,但我似乎无法解决这个问题,所以它看起来并不奇怪

<template>
  <div class="container">
    <header>
      <h1>GIF'S APP</h1>
      <form>
        <span class="font-semibold mr-2 text-left flex-auto text-white">Search for the coolest gifs</span>
        <div>
          <b-nav-form>
            <b-input-group>
              <b-form-input id="input-small" size="sm" type="text" v-model="search" />
              <b-button class="btn-success" type="button" v-on:click="searchNewGifs()">Search</b-button>
              <div class="gifs--container">
                <Gif v-for="gif in gifs" v-bind:key="gif.id" v-bind:data="gif"></Gif>
              </div>
              <b-button
                class="btn-success"
                type="button"
                v-if="!stopNextPage"
                v-on:click="getNextPage()"
              >Next Page</b-button>
            </b-input-group>
          </b-nav-form>
        </div>
      </form>
    </header>
  </div>
</template>

【问题讨论】:

    标签: vue.js gif bootstrap-vue


    【解决方案1】:

    使用mx-auto 水平中心类和my-auto 垂直中心类,如果你想使水平和垂直中心使用m-auto 和注意:非常重要的是父类具有dispaly: flex 和可用的类是d-flex

    【讨论】:

      猜你喜欢
      • 2014-04-27
      • 2017-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-12
      • 2019-04-19
      • 1970-01-01
      相关资源
      最近更新 更多