我的div无法覆盖页面的顶部和侧面。有一个怪异的差距。该div在body标签内。我为正文和div添加了边距和填充为零。它不会消失。
<style scoped>
body {
padding: 0; margin: 0;
}
#navdiv {
width: 100%;
text-align: center;
height: 5rem;
background-color: white;
padding: 0;
margin: 0;
display: inline-block;
font-family: 'Lato', sans-serif;
}
a {
text-decoration: none;
color:rgb(31, 32, 32);
border-bottom: 0.05rem dotted black;
padding: 1.0rem;
}
a:hover {
background-color: rgb(88, 88, 88);
transition: all 0.8s ease;
color: white;
}
</style>
<template>
<div id="navdiv">
<nav id="nav1" @mouseover="mouseOver">
<div v-show="active">show</div>
<router-link v-for="routes in links"
v-bind:key="routes.id"
:to="`${routes.page}`">{{routes.text}}</router-link>
</nav>
</div>
</template>
答案 0 :(得分:0)
您尝试过margin: 0; padding:0
像这样:
template, div {
padding: 0;
margin: 0;
}