纯css实现导航条滚动后固定和锚点导航

代码语言:html

所属分类:菜单导航

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/normalize.css">
<style>
html, body {
  height: 100%;
  max-height: 100%;
  overflow: auto;
  scroll-behavior: smooth;
}

*, input {
  box-sizing: border-box;
}

.site-wrapper {
  padding-top: 30px;
}
.site-wrapper:before {
  content: '';
  display: block;
  height: 10px;
  width: 100%;
  position: absolute;
  z-index: 999;
  top: 50px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 100%);
}

[class*="button"] {
  display: block;
  padding: 10px 20px;
  box-shadow: inset 0 0 0 1px #005d80;
  margin-left: 5px;
  border-radius: 5px;
  text-decoration: none;
  color: #005d80;
}
[class*="button"]:hover {
  color: #00baff;
  box-shadow: inset 0 0 0 1px #00baff;
}
[class*="button"][class*="-prominent"] {
  background-color: #005d80;
  color: white;
  box-shadow: none;
  border: none;
}
[class*="button"][class*="-prominent"]:hover {
  background-color: #00baff;
}

.login-form {
  position: absolute;
  top: 0;
  background: white;
  hei.........完整代码请登录后点击上方下载按钮下载查看

网友评论0