此前写的那个太复杂了,来点简单的核心

<html>
<head>
<title></title>
<style type="text/css"> * { margin: 0; padding: 0; border: none; } .Bl {
width: 600px;
height: 540px;
margin: 0 auto;
position: relative;
top: 50%;
transform: translateY(-50%);
} .Bl > input {
width: 20%;
height: 40px;
position: absolute;
cursor: pointer;
opacity: 0;
} .Bl input:nth-of-type(1){ left: 0%; }
.Bl input:nth-of-type(2){ left: 20%; }
.Bl input:nth-of-type(3){ left: 40%; }
.Bl input:nth-of-type(4){ left: 60%; }
.Bl input:nth-of-type(5){ left: 80%; } /*切换效果*/ .Bl input:nth-of-type(1):checked ~ span:nth-of-type(1) { color: white; } /* ~ 选择兄弟元素 */
.Bl input:nth-of-type(2):checked ~ span:nth-of-type(2) { color: white; }
.Bl input:nth-of-type(3):checked ~ span:nth-of-type(3) { color: white; }
.Bl input:nth-of-type(4):checked ~ span:nth-of-type(4) { color: white; }
.Bl input:nth-of-type(5):checked ~ span:nth-of-type(5) { color: white; } .Bl input:nth-of-type(1):checked ~ .pagebox > .pages { }
.Bl input:nth-of-type(2):checked ~ .pagebox > .pages { transform: translateY(-100%); }
.Bl input:nth-of-type(3):checked ~ .pagebox > .pages { transform: translateY(-200%); }
.Bl input:nth-of-type(4):checked ~ .pagebox > .pages { transform: translateY(-300%); }
.Bl input:nth-of-type(5):checked ~ .pagebox > .pages { transform: translateY(-400%); } span {
display: block;
width: 20%;
height: 40px;
background-color: red;
float: left;
text-align: center;
line-height: 40px;
font-size: 20px;
} .pagebox,.pages {
width: 100%;
height: 500px;
} .pagebox {
overflow: hidden;
} .pages {
transition: all 0.5s;
} .page {
width: 100%;
height: 100%;
text-align: center;
font-family: "微软雅黑";
font-size: 30px;
line-height: 500px;
color: white;
} .page1 { background-color: pink; }
.page2 { background-color: blue; }
.page3 { background-color: red; }
.page4 { background-color: green; }
.page5 { background-color: black; } </style>
</head>
<body>
<div class="Bl">
<input type="radio" name="btn" checked ><span>1</span>
<input type="radio" name="btn" ><span>2</span>
<input type="radio" name="btn" ><span>3</span>
<input type="radio" name="btn" ><span>4</span>
<input type="radio" name="btn" ><span>5</span>
<section class="pagebox">
<div class="pages">
<div class="page page1">This is page1</div>
<div class="page page2">This is page2</div>
<div class="page page3">This is page3</div>
<div class="page page4">This is page4</div>
<div class="page page5">This is page5</div>
</div>
</section>
</div> </body>
</html>

【CSS3】纯CSS3制作页面切换效果的更多相关文章

  1. Android - FragmentTabHost 与 Fragment 制作页面切换效果

    使用 FragmentTabHost 与 Fragment 制作页面切换效果 API 19 TabHost已经不建议使用了.用 FragmentTabHost 来代替TabHost.实际上 Fragm ...

  2. Android - TabHost 与 Fragment 制作页面切换效果

    Android - TabHost 与 Fragment 制作页面切换效果 Android API 19 , API 23 三个标签页置于顶端 效果图: 在文件BoardTabHost.java中定义 ...

  3. 基于html5和css3响应式全屏滚动页面切换效果

    分享一款全屏响应式的HTML5和CSS3页面切换效果.这个页面布局效果对于那些页面要求固定100%高度和宽度的网站和APP来说是十分有用的.效果图如下: 在线预览   源码下载 HTML wrappe ...

  4. jquery mobile页面切换效果(Flip toggle switch)(注:jQuery移动使用的数据属性的列表。 )

    1.页面切换(data-transition)

  5. html5各种页面切换效果和模态对话框

    页面动画:data-transition 属性可以定义页面切换是的动画效果.例如:<a href="index.html" data-transition="pop ...

  6. WP8 NavigationInTransition实现页面切换效果

    NavigationInTransition这个是实现页面切换效果,而且没控件来拖,要自己手动写, 将App.xaml.cs中InitializePhoneApplication()函数里的RootF ...

  7. 在uwp仿IOS的页面切换效果

    有时候我们需要编写一些迎合IOS用户使用习惯的uwp应用,我在这里整理一下仿IOS页面切换效果的代码. 先分析IOS的页面切换.用户使用左右滑动方式进行前进和后退,播放类似于FlipView的切换动画 ...

  8. [Swift通天遁地]九、拔剑吧-(7)创建旋转和弹性的页面切换效果

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  9. [Swift通天遁地]九、拔剑吧-(8)创建气泡式页面切换效果

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

随机推荐

  1. Leetcode6.ZigZag ConversionZ字形变换

    将字符串 "PAYPALISHIRING" 以Z字形排列成给定的行数: 之后从左往右,逐行读取字符:"PAHNAPLSIIGYIR" 实现一个将字符串进行指定行 ...

  2. SQL Sever实验二 交互式 SQL

    一. 实验目的 1.观察查询结果, 体会 SELECT 语句实际应用: 2.要求学生能够使用 SELECT 语句进行数据库查询. 3. 熟练掌握各种查询的操作方法. 二. 实验准备 1. 完成实验一所 ...

  3. R语言可视化--颜色

    RColorBrewer包 三类调色板:sequential / diverging / qualitative 调色板的信息可以与colorRamp / colorRampPalette结合使用 从 ...

  4. 模拟4题解 T3奇袭

    T3奇袭 题目描述 由于各种原因,桐人现在被困在Under World(以下简称UW)中,而UW马上 要迎来最终的压力测试——魔界入侵. 唯一一个神一般存在的Administrator被消灭了,靠原本 ...

  5. HR招聘_(四)_招聘方法论(简历筛选)

    .主动投递 筛选时需要看学历背景,公司平台,所在时间,岗位职责,项目经验几个部分,根据对岗位需求和企业文化选择合适的候选人. 筛选简历建议分岗位筛选,切记误操作或大意淘汰优秀候选人. .搜索下载 互联 ...

  6. TSP

    #include <iostream> #include <limits.h> #include <string.h>; using namespace std; ...

  7. SQL —— 存储过程

    一.什么是存储过程 预先存储好的SQL程序. 保存在SQL Server中(跟视图的存储方式一样) 通过名称和参数执行. 二.存储过程的优点 执行速度更快 允许模块化程序设计 提高系统安全性 减少网络 ...

  8. Ubuntu的网络共享

    实际场景 公司项目中遇到一个场景:Ubuntu的主机上装了个4G卡(USB模式),需要将这个4G网共享给一个AP,使得所有连接AP的移动设备都可以通过4G上外网 方法很简单: 1. 将4G网口之外的另 ...

  9. Least Common Multiple (最小公倍数,先除再乘)

      思路: 求第一个和第二个元素的最小公倍数,然后拿求得的最小公倍数和第三个元素求最小公倍数,继续下去,直到没有元素 注意:通过最大公约数求最小公倍数的时候,先除再乘,避免溢出   #include ...

  10. python ndarray相关操作:切分