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

<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. pytest 用 @pytest.mark.usefixtures("fixtureName")或@pytest.fixture(scope="function", autouse=True)装饰,实现类似setup和TearDown的功能

    conftest.py import pytest @pytest.fixture(scope="class") def class_auto(): print("&qu ...

  2. ubuntu安装搜狗输入法后无法使用goland的快捷键 ctrl+alt+B

    安装了搜狗拼音后,其快捷键ctrl+alt+b会启动软键盘,造成与其他编辑器快捷键的冲突. 为了禁止使用ctrl+alt+b启动软键盘,可以: 1. 在搜狗拼音输入法选择设置 2. 高级设置 3. 高 ...

  3. Android中使用ormlite实现持久化--HelloOrmLite

    Android中内置了sqlite,但是常用的开发语言java是面向对象的,而数据库是关系型的,二者之间的转化每次都很麻烦(主要是我对sql语言不熟悉).而Java Web开发中有很多orm框架,但是 ...

  4. css Position 上下左中右布局

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...

  5. Mysql查询优化-DB篇

    本文重点从数据库本身角度,硬件和环境的优化不在本文范围内 1. 使用索引(Index All Columns Used in 'where', 'order by', and 'group by' C ...

  6. 用gradle4.4转化spring,发现依赖包integration-0.9.15.jar已经不在

    用gradle4.4转化spring,发现依赖包integration-0.9.15.jar已经不在仓库了,应该怎么解决? 解决办法如下: 1  修改build.gradle文件,将id " ...

  7. [LeetCode] Evaluate Reverse Polish Notation [2]

    题目 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, ...

  8. python 切片索引

  9. 洛谷 P1948 [USACO08JAN]电话线Telephone Lines 最短路+二分答案

    目录 题面 题目链接 题目描述 输入输出格式 输入格式 输出格式 输入输出样例 输入样例 输出样例 说明 思路 AC代码 题面 题目链接 P1948 [USACO08JAN]电话线Telephone ...

  10. URL编程

    package com.tanlei.URL; import java.io.File; import java.io.FileOutputStream; import java.io.IOExcep ...