Reputation: 1444
I am trying to create a n x 3
matrix sort of layout. In which each element is a card. I am trying to implement it using vuetify. But, the problem is the cards are getting displayed, but there is no space between them. Even if i add a new row in it. There is no distance between that too.
I have tried using different classes and normal HTML & CSS. But it is not making it responsive
This is how the code loooks like
<template lang="html">
<v-container>
<v-layout>
<v-flex xs12 md4>
<v-card>
<v-img
class="white--text"
height="200px"
src="https://cdn.vuetifyjs.com/images/cards/docks.jpg"
>
<!-- <v-container> -->
<v-layout>
<v-flex xs12 align-end flexbox>
<span class="headline">Top 10 Australian beaches</span>
</v-flex>
</v-layout>
<!-- </v-container> -->
</v-img>
<v-card-title>
<div>
<span class="grey--text">Number 10</span><br>
<span>Whitehaven Beach</span><br>
<span>Whitsunday Island, Whitsunday Islands</span>
</div>
</v-card-title>
<v-card-actions>
<v-btn flat color="orange">Share</v-btn>
<v-btn flat color="orange">Explore</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs12 md4>
<v-card>
<v-img
class="white--text"
height="200px"
src="https://cdn.vuetifyjs.com/images/cards/docks.jpg"
>
<v-container>
<v-layout>
<v-flex xs12 align-end flexbox>
<span class="headline">Top 10 Australian beaches</span>
</v-flex>
</v-layout>
</v-container>
</v-img>
<v-card-title>
<div>
<span class="grey--text">Number 10</span><br>
<span>Whitehaven Beach</span><br>
<span>Whitsunday Island, Whitsunday Islands</span>
</div>
</v-card-title>
<v-card-actions>
<v-btn flat color="orange">Share</v-btn>
<v-btn flat color="orange">Explore</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs12 md4 >
<v-card>
<v-img
class="white--text"
height="200px"
src="https://cdn.vuetifyjs.com/images/cards/docks.jpg"
>
<v-container>
<v-layout>
<v-flex xs12 align-end flexbox>
<span class="headline">Top 10 Australian beaches</span>
</v-flex>
</v-layout>
</v-container>
</v-img>
<v-card-title>
<div>
<span class="grey--text">Number 10</span><br>
<span>Whitehaven Beach</span><br>
<span>Whitsunday Island, Whitsunday Islands</span>
</div>
</v-card-title>
<v-card-actions>
<v-btn flat color="orange">Share</v-btn>
<v-btn flat color="orange">Explore</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
//New Row
<v-layout>
<v-flex xs12 md4 >
<v-card>
<v-img
class="white--text"
height="200px"
src="https://cdn.vuetifyjs.com/images/cards/docks.jpg"
>
<v-container>
<v-layout>
<v-flex xs12 align-end flexbox>
<span class="headline">Top 10 Australian beaches</span>
</v-flex>
</v-layout>
</v-container>
</v-img>
<v-card-title>
<div>
<span class="grey--text">Number 10</span><br>
<span>Whitehaven Beach</span><br>
<span>Whitsunday Island, Whitsunday Islands</span>
</div>
</v-card-title>
<v-card-actions>
<v-btn flat color="orange">Share</v-btn>
<v-btn flat color="orange">Explore</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</v-container>
</template>
This is how the page looks like right now.
how do I add space between the cards and make it responsive as well.
Thanks for help!
Upvotes: 0
Views: 10231
Reputation: 86
I just tried your scenario. you have to add this line.
<v-container grid-list-md>
instead of
<v-container>
Here is running example. https://codepen.io/anon/pen/EBNPQb?&editable=true&editors=101
Upvotes: 4