设为首页收藏本站关注微信<<< 抵制 IE6 人人有责 >>>
搜索
热搜: 活动 交友 discuz
查看: 1843|回复: 0
打印 上一主题 下一主题

[CSS] 纯Css选项卡

[复制链接]
跳转到指定楼层
楼主
发表于 2017-2-14 04:34:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[HTML] 纯文本查看 复制代码
<section>

<input id="tab-one" type="radio" name="grp" checked="checked"/>
<label for="tab-one">Tab One</label>
<div>
  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</div>

<input id="tab-two" type="radio" name="grp" />
<label for="tab-two">Tab Two</label>
<div>
  <img src="http://sbarthel.github.io/images/img/berg.JPG" alt="mountain" />
</div>

<input id="tab-three" type="radio" name="grp" />
<label for="tab-three">Tab Three</label>
<div>
  ... no fixed height for tabbed area!
</div>

</section>


[CSS] 纯文本查看 复制代码
body {
  font-family: Arial;
   color: #333;
}
section {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}

label {
  background: #eee; 
  border: 1px solid #ddd; 
  padding: .7em 1em;
  cursor: pointer;
  z-index: 1;
  margin-left: -1px;
}
label:first-of-type {
  margin-left: 0;
}
div {
  width: 100%;
  margin-top: -1px;
  padding: 1em;
  border: 1px solid #ddd;
  -webkit-order: 1;
  order: 1;
}
input[type=radio], div {
  display: none;
}
input[type=radio]:checked + label {
  background: #fff;
  border-bottom: 1px solid #fff;
}
input[type=radio]:checked + label + div {
  display: block;
}


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享淘帖
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|手机版|Archiver|源于生活(个人生活娱乐工作的笔记)css3,html5,学习笔记    

GMT+8, 2024-4-20 14:47 , Processed in 0.078000 second(s), 25 queries .

Powered by Mr.Kevin-ying

© 2004-2015

快速回复 返回顶部 返回列表