32 lines
427 B
HTML
32 lines
427 B
HTML
<style>
|
|
body {
|
|
height: 2000px;
|
|
}
|
|
|
|
div {
|
|
width: 300px;
|
|
height: 300px;
|
|
background-color: green;
|
|
}
|
|
|
|
.container {
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.fixed {
|
|
position: fixed;
|
|
left: 150px;
|
|
top: 150px;
|
|
background-color: red;
|
|
}
|
|
.absolute {
|
|
position: absolute;
|
|
left: 200px;
|
|
top: 100px;
|
|
background-color: blue;
|
|
}
|
|
</style>
|
|
|
|
<div class=container><div class=fixed></div><div class=absolute></div></div>
|