css模拟手机端移动端菜单跳转效果代码

代码语言:html

所属分类:菜单导航

代码描述:css模拟手机端移动端菜单跳转效果代码

代码标签: 移动 菜单 跳转 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
.menu {
  padding: 15px 15px;
  background: white;
}
.menu .category {
  margin: 12px 0 24px;
}
.menu h2 {
  margin: 10px 0 20px -30px;
  padding: 0 20px 0px 30px;
  border-radius: 0 20px 60px 0;
  background: red;
  color: white;
  width: auto;
  display: inline-block;
  font-size: 32px;
  font-weight: 400;
  font-family: "Yellowtail";
  box-shadow: 2px 2px 0px white, 4px 4px 0px red, 6px 6px 0px white,
			8px 8px 0px red;
}
.menu p {
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
}
.menu p:last-of-type {
  border: none;
}
.menu span + span {
  float: right;
}
.header {
  border-radius: 100px;
  margin: 32px auto 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.header::before {
  background: pink;
  width: 2.82in;
  height: 120px;
  position: absolute;
  top: 72px;
  transform: skewy(-5deg);
  z-index: -1;
  content: "";
}
.header h1 {
  line-height: 1;
  font-family: "yellowtail";
  color: white;
  width: 150px;
  height: 150px;
  border-radius: 150px;
  transform: rotate(-6deg);
  text-align: center;
  margin-bottom: 24px;
  background: red;
  box-shadow: 0 0 0 5px white;
  display: flex;
  justify-content: center;
  align-items: center;
}
nav {
  list-style: none;
  padding: 0 5px;
  text-align: center;
}
nav li {
  background: red;
  display: inline-block;
  margin: 5px 2.5px;
  border-radius: 36px 6px;
  box-shadow: 2px 2px 0px white, 4px 4px 0px red;
  position: relative;
  top: 0;
  left: 0;
  transition: 200ms all;
}
nav li a {
  text-decoration: none;
  color: white;
  display: block;
  padding: 10px 20px;
}
nav li:hover {
  box-shadow: 0px 0px 0px white, 2px 2px 0px #b30000;
  top: 2px;
  left: 2px;
}
nav li:active {
  box-shadow: 0 0 0 white, 0 0 0 red;
  top: 4px;
  left: 4px;
}
.phone {
  width: 2.82in;
  height: 5.78in;
  box-shadow: 0px 0px 0px 10px #333, 0px 10px 30px rgba(0, 0, 0, 0.8);
  border-radius: 24px;
  overflow: scroll;
  scroll-behavior: smooth;
  position: relative;
}
.flex {
  display: flex;
  justify-content: center;
  align-items: center;
}
body {
  font-family: "Balsamiq Sans", sans-serif;
  color: black;
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/balsamiqsans/v3/P5sEzZiAbNrN8SB3lQQX7Pnc8dk.ttf) format('truetype');
}
@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/balsamiqsans/v3/P5sZzZiAbNrN8SB3lQQX7PncyWUyBY8.ttf) format(.........完整代码请登录后点击上方下载按钮下载查看

网友评论0