【发布时间】:2022-10-01 02:53:40
【问题描述】:
我第一次尝试使用 Vue.js 制作登录页面,但我试图让登录页面占据整个页面。由于某种原因 CSS 被覆盖,我应该怎么做才能将高度设置为 100%?
<template>
<body>
<div id=\"logo\">
Logo aqui
</div>
<hr width=\"1\" size=\"500\" style=\"0 auto\" />
<div id=\"login\">
<LoginForm />
</div>
</body>
</template>
<script lang=\"ts\">
import LoginForm from \"@/components/login/LoginForm.vue\";
export default {
name: \"LoginPage\",
components: { LoginForm }
}
</script>
<style scoped>
.line{
border-left: 6px white;
height: 500px;
width: 6px;
}
html, body{
height:100%; /*both html and body*/
}
body{
margin: 0; /*reset default margin*/
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap:200px;
background-image: linear-gradient(#153C66, #001B37);
}
</style>