vuetify center items into v-flex

后端 未结 3 857
生来不讨喜
生来不讨喜 2020-12-09 08:08

I\'m trying to center a into a . Since is a flexbox div, I use justify-center

相关标签:
3条回答
  • 2020-12-09 08:38

    v-flex does not have a display flex! Inspect v-flex in your browser and you will find out it is just a simple block div.

    So, you should override it with display: flex in your HTML or CSS to make it work with justify-content.

    0 讨论(0)
  • 2020-12-09 08:41

    wrap button inside <div class="text-xs-center">

    <div class="text-xs-center">
      <v-btn primary>
        Signup
      </v-btn>
    </div>
    

    Dev uses it in his examples.


    For centering buttons in v-card-actions we can add class="justify-center" (note in v2 class is text-center (so without xs):

    <v-card-actions class="justify-center">
      <v-btn>
        Signup
      </v-btn>
    </v-card-actions>
    

    Codepen


    For more examples with regards to centering see here

    0 讨论(0)
  • 2020-12-09 08:55
    <v-layout justify-center>
      <v-card-actions>
        <v-btn primary>
         <span>SignUp</span>
        </v-btn>`enter code here`
      </v-card-actions>
    </v-layout>
    
    0 讨论(0)
提交回复
热议问题