纯CSS,label+input+section实现tab功能
来源:互联网 发布:妖姬 知乎 编辑:程序博客网 时间:2024/04/30 00:19
非常简易实用的代码,并没有华丽丽的效果,也没有华丽丽的代码。
一切为了实用!
<style>html,body {height: 100%;}body {font: 14px/1 'Open Sans', sans-serif;color: #555;background: #eee;}h1 {padding: 50px 0;font-weight: 400;text-align: center;}p {margin: 0 0 20px;line-height: 1.5;}main {min-width: 320px;max-width: 800px;padding: 50px;margin: 0 auto;background: #fff;}section {display: none;padding: 20px 0 0;border-top: 1px solid #ddd;}input {display: none;}label {display: inline-block;margin: 0 0 -1px;padding: 15px 25px;font-weight: 600;text-align: center;color: #bbb;border: 1px solid transparent;}label:before {font-family: fontawesome;font-weight: normal;margin-right: 10px;}label[for*='1']:before {content: '\f1cb';}label[for*='2']:before {content: '\f17d';}label[for*='3']:before {content: '\f16b';}label[for*='4']:before {content: '\f1a9';}label:hover {color: #888;cursor: pointer;}input:checked + label {color: #555;border: 1px solid #ddd;border-top: 2px solid orange;border-bottom: 1px solid #fff;}#tab1:checked ~ #content1,#tab2:checked ~ #content2,#tab3:checked ~ #content3,#tab4:checked ~ #content4 {display: block;}@media screen and (max-width: 650px) {label {font-size: 0;}label:before {margin: 0;font-size: 18px;}}@media screen and (max-width: 400px) {label {padding: 15px;}}</style><h1>Tommy bad bad</h1><main><input id="tab1" type="radio" name="tabs" checked><label for="tab1">1</label><input id="tab2" type="radio" name="tabs"><label for="tab2">2</label><input id="tab3" type="radio" name="tabs"><label for="tab3">3</label><input id="tab4" type="radio" name="tabs"><label for="tab4">4</label><section id="content1"><p>1</p><p>1</p></section><section id="content2"><p>2</p><p>2</p></section><section id="content3"><p>3</p><p>3</p></section><section id="content4"><p>4</p><p>4</p></section></main>
0 0
- 纯CSS,label+input+section实现tab功能
- 纯css 实现tab效果
- 纯css实现tab切换
- 纯CSS实现tab切换
- 纯css实现tab切换
- CSS JQuery input+label实现placeholder效果
- 纯 css实现tab切换效果
- 纯 CSS 实现 tab 页切换
- 使用纯css实现tab切换
- javascript+css 实现tab功能
- javascript+css 实现tab功能
- javascript+css 实现tab功能
- jQuery+css实现tab功能
- 纯css label写轮播图
- 纯CSS标签tab
- 纯CSS实现Tab切换 以及 CSS+JS实现Tab切换
- jQuery + CSS 实现Tab分页功能
- 纯css实现Tab切换的两种方法
- LNK2019:win32下编写DLL,应用程序找不到DLL接口函数的一种情况
- java集合排序——Collections.sort()的两种用法
- 【LeetCode】355. Design Twitter
- netcat——Useful netcat examples on Linux
- PHP学习笔记
- 纯CSS,label+input+section实现tab功能
- 第十六周阅读程序2
- Presenting view controllers on detached view controllers is discouraged
- S3C2440裸机程序【2】串口uart程序
- 6类文件结构
- 第15周阅读程序(3)
- 关于JQuery
- MongoDB 3.0 安全权限访问控制
- 移动互联网SP计费