[Help] How to center items in v-container's horizon and vertical view
See original GitHub issueSteps to reproduce
- I use below code to layout my whole page content:
<div id="app">
<v-app id="inspire">
<!-- -->
<v-toolbar fixed :dense="true" class="primary" :dark="true" scroll-off-screen scroll-target="#scrolling-main">
<!-- <v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon> -->
<v-toolbar-title>xxxx</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="search" hide-details single-line></v-text-field>
<v-toolbar-items class="hidden-sm-and-down">
<v-btn to="/">Home</v-btn>
</v-toolbar-items>
<v-toolbar-items class="hidden-sm-and-down">
<v-btn to="/about">About</v-btn>
</v-toolbar-items>
</v-toolbar>
<main id="scrolling-main">
<v-container class="text-xs-center" style="min-height: 100vh">
<!--vue-router-->
<v-layout row child-flex justify-center align-center wrap>
<v-flex fill-height>
<v-btn>test
</>
</v-flex>
</v-layout>
</v-container>
</main>
</v-app>
</div>
- You can see
v-btn
is located in the first row ,not in the center ofv-layout
. what my purpose is to center all the items inv-layout
in vertical view . had triedfill-height
but no affect . - Please help see the provided link let me know if i need to add some other custom styles
Versions
Latest Vue 2.4.2 Latest Vuetify 0.14.11
What is expected ?
- Use the
fill-height
it should center to thev-container
What is actually happening ?
- Try any properties i had found, but still it not located in the center view.
Reproduction Link
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
CSS: centering things - W3C
Centering vertically and horizontally in CSS level 3 ... We can extend both methods to center horizontally and vertically at the same time....
Read more >How to Center an Image Vertically and Horizontally with CSS
The third way to center an image horizontally is by using display: flex . Just like we used the text-align property for a...
Read more >15 ways to implement vertical alignment with CSS
Learn 15 ways to implement vertical alignment for text with CSS, such as explicit grid row placement and pseudo-elements on flex containers.
Read more >CSS Grid center vertical and horizontal [2022 Tutorial]
Guide to teach you how to center an HTML element horizontally and vertically using CSS Grid.
Read more >Flexbox: center horizontally and vertically - Stack Overflow
If you want the .row to be centered vertically in the view port, assign 100% height to html and body , and also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is one way you can do it. https://codepen.io/nekosaur/pen/MvQjgL
Am I wrong or solution proposed by @nekosaur really isn’t centering element up vertically? Only horizontally.