html css锚定节点,用纯css实现锚点定位的动画效果

div-1

div-2

div-3

第一页

第二页

第三页

* {

margin: 0;

padding: 0

}

html,body {

height: 100%;

height: 100%;

background: #a3ceff;

overflow: hidden;

}

.top {

width: 100%;

height: 40px;

line-height: 40px;

background: rgba(0, 0, 0, .6);

position: fixed;

z-index: 9;

}

.top label {

display: inline-block;

width: 30%;

color: #fff;

text-align: center;

cursor: pointer;

}

.top label:hover {

background: rgba(0, 0, 0, .4);

}

input {

display: none;

}

h1 {

color: #fff;

padding-top: 20%;

}

.page {

position: absolute;

top: 0;

left: 0;

width: 100%;

height: 100%;

min-height: 100%;

background: #3C98FF;

text-align: center;

transform: translateY(-100%);

transition: .6s;

}

input[type=radio]:checked + .page {

transform: translateY(0);

animation: fromBtm .4s;

}

@keyframes fromBtm {

from { transform: translateY(100%); }

to { }

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值