[英]My Vuetify element has an unexpected margin, how do I remove it?
I'm trying to write a landing page, and I'm attempting to use a v-parallax element that covers the whole page and can be scrolled down.我正在尝试编写一个着陆页,并且我正在尝试使用覆盖整个页面并且可以向下滚动的 v-parallax 元素。
In my code, I have a view named LandingPage.vue, a component named TopPageParralax.vue, and then my main App.vue.在我的代码中,我有一个名为 LandingPage.vue 的视图,一个名为 TopPageParralax.vue 的组件,然后是我的主 App.vue。
LandingPage.vue:登陆页面.vue:
<template>
<v-container>
<top-page-parralax />
</v-container>
</template>
<style></style>
<script>
import TopPageParralax from "@/components/TopPageParralax.vue";
export default {
name: `LandingPage`,
components: {TopPageParralax},
};
</script>
<style>
</style>
TopPageParralax.vue: TopPageParralax.vue:
<template>
<v-container>
<v-parallax height="100vh" src="https://braydenjohnsondevlandiing.s3.amazonaws.com/Complex+Square+Grid+With+Drop+Shadows.png">
<v-row class="fill-height" align="center" justify="center">
<v-col cols="12" class="text-center">
<h1 class="display-2 font-weight-bold mb-3">Brayden Johnson</h1>
<h2 class="display-4 font-weight-light">Front End Web Developer</h2>
</v-col>
</v-row>
</v-parallax>
</v-container>
</template>
<style>
v-parallax {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
</style>
<script lang='ts'>
import { defineComponent } from 'vue'
export default defineComponent({
name: 'TopPageParralax',
});
</script>
App.vue App.vue
<template>
<v-app>
<v-main>
<router-view/>
</v-main>
</v-app>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'App',
})
</script>
<style> </style>
I'm expecting no margin, however I get the following result:我期望没有利润,但是我得到以下结果:
For some information: I'm using Chrome V108.0.5359.126 and Vue 3 with Vuetify 3有关一些信息:我将 Chrome V108.0.5359.126 和 Vue 3 与 Vuetify 3 一起使用
You need to add the fluid
property to v-container
which fully extends the width.您需要将
fluid
属性添加到v-container
以完全扩展宽度。
To remove the default margin add ma-0
property to component class property要删除默认边距,请将
ma-0
属性添加到组件 class 属性
To remove the default padding add pa-0
property to component class property要删除默认填充,请将
pa-0
属性添加到组件 class 属性
Actually, the theme installed site is distracting.实际上,主题安装站点令人分心。 If you want to define your custom property then use.important suffex to css property.
如果您想定义自定义属性,请使用 .important 后缀到 css 属性。 e:g margin;
例如:保证金; 10px !important;
10px 重要;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.