Scroll relative to bottom of screen
From my experiments, setting flex-direction: column-reverse on the body doesn't work, it has to be a separate element. Maybe I made a mistake somewhere though. In any case, this code seems to work properly.
This commit is contained in:
parent
32d68cb60c
commit
e8c09f3b6d
1 changed files with 13 additions and 9 deletions
|
|
@ -3,12 +3,23 @@ import CSegment from "./components/CSegment.vue";
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="strip">
|
||||
<CSegment />
|
||||
<div class="scroll">
|
||||
<div class="strip">
|
||||
<CSegment />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scroll {
|
||||
height: 100dvh;
|
||||
overflow: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.strip {
|
||||
box-sizing: content-box;
|
||||
width: 384px;
|
||||
|
|
@ -45,13 +56,6 @@ h2 {
|
|||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100dvh;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
align-items: center;
|
||||
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue