div+css实现粘性导航菜单点击滚动效果代码

代码语言:html

所属分类:菜单导航

代码描述:div+css实现粘性导航菜单点击滚动效果代码

代码标签: div css 粘性 导航 菜单 点击 滚动

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

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

<head>
  <meta charset="UTF-8">
  

  
  
  
  
<style>
html {
  cursor: none;
  --text: #FFF;
  background: #001220;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 1.5rem;
}

nav {
  width: 100%;
  background-color: rgba(76, 76, 76, 0.36);
  color: black;
  padding: 10px 0;
  text-align: center;
  display: flex;
  justify-content: space-around;
  border-radius: 5rem;
  backdrop-filter: blur(4px);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: space-between;
  width: 80%;
}
nav ul li {
  font-weight: bold;
}

a {
  text-decoration: none;
  color: var(--text);
}

section {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

h2 {
  transition: font-size 300ms ease-out;
  font-size: 20vw;
  color: #fff;
  background: -webkit-linear-gradient(45deg, #09009f, #00ff95 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-box-reflect: below 10px linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0