Reputation: 33
How can I put my navbar component in the centre? This is my first time doing this I got most of it ok but I just can't seem to fix this problem so it doesn't look weird
<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>
Upvotes: 3
Views: 3350
Reputation: 16513
use class mx-auto
horizontal centre and class my-auto
for vertical centre and if you you want to make horizontal and vertical centre use m-auto
and NOTE: very important is that the parent have the style dispaly: flex
and the class available for that is d-flex
.
Upvotes: 5