html
<div class="text">
捡猫的博客
</div>
css
body{
height:2000px;
}
.text{
width:300px;
height:100x;
background:skyblue;
position:fixed;
right:0;
bottom:100px;
font-size:30px;
color:white;
text-align:center;
line-height:100px
}
fixed定位的核心css代码为
position:fixed;
right:0;
bottom:100px;
body中css是为了出现滚动条,更好展示fixed定位的效果
body{
height:2000px;
}
其他的只是为了美观