div+css模拟手机底部tab选项卡切换效果代码

代码语言:html

所属分类:选项卡

代码描述:div+css模拟手机底部tab选项卡切换效果代码

代码标签: div css 模拟 手机 底部 tab 选项卡 切换

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.5.15.3.css">
<style>
    @import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: rgba(155, 89, 182, 0.7);
  font-family: "Open Sans", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
}

.phone {
  position: relative;
  overflow: hidden;
  border: 3px solid #eee;
  border-radius: 15px;
  height: 600px;
  width: 340px;
}

.phone .content {
  opacity: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  height: calc(100% - 60px);
  width: 100%;
  transition: opacity 0.4s ease;
}

.phone .content.show {
  opacity: 1;
}

nav {
  position: absolute;
  bottom: 0;
  left: 0;
  margin-top: -5px;
  width: 100%;
}

nav ul {
  background: #fff;
  display: flex;
  list-style-type: none;
  padding: 0;
  margin: 0;
  height: 60px;
}

nav li {
  color: #777;
  cursor: pointer;
  flex: 1;
  padding: 10px;
  text-align: center;
}

nav ul li p {
  font-size: 12px;
  margin: 2px 0;
}

nav ul li:hover,
nav ul li.active {
  color: #8e44ad;
}
</style>
</head>
<body>
<!-- partial:index.partial.html -->
<div class="phone">
  <img src="//repo.bfw.wiki/bfwrepo/image/63e4558d11b3a.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_400,h_650,/quality,q_90" alt="home" class="content show">
  <img src="//repo.bfw.wiki/bfwrepo/image/64af58dbcd3e2.png?x-oss-process=image/auto-o.........完整代码请登录后点击上方下载按钮下载查看

网友评论0