背景经典页面布局

代码语言:html

所属分类:布局界面

代码描述:背景经典页面布局

代码标签: 布局

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
@import url("https://fonts.googleapis.com/css?family=Montserrat:300&display=swap");
* {
  font-family: 'Montserrat', serif;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.navbar {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 100vw;
  min-height: 4rem;
  padding: 0 200px;
  justify-content: space-between;
  align-items: center;
  overflow: auto;
  background: white;
  z-index: 1000;
}
@media (max-width: 920px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    width: 100%;
    box-shadow: 0 0 1px gray;
  }
}
.navbar .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 920px) {
  .navbar .row {
    width: 100%;
  }
}
.navbar button {
  cursor: pointer;
  background: white;
  border: none;
  outline: none;
  font-size: 1rem;
  margin-right: 2rem;
}
@media (max-width: 920px) {
  .navbar button {
    height: 4rem;
    display: flex;
    flex-direction: center;
    justify-content: center;
    align-items: center;
  }
}
.navbar .brand {
  position: relative;
  transform-origin: center;
  height: 4rem;
  padding-right: 0.625rem;
  background: white;
}
.navbar .brand:hover::before {
  animation: 1s spin;
}
.navbar .brand::before {
  position: absolute;
  content: "";
  top: 1.375rem;
  right: 0;
  width: 2px;
  height: 1.25rem;
  border-left: solid 2px #CF450B;
}
.navbar .menu-btn {
  margin-right: 0;
  padding-right: 0.625rem;
}
@media (min-width: 920px) {
  .navbar .menu-btn {
    display: none;
  }
}
.navbar .tab {
  color: gray;
}
.navbar .tab:nth-last-child(1) {
  margin-right: 0;
}
@media (max-width: 920px) {
  .navbar .tabs {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
  .na.........完整代码请登录后点击上方下载按钮下载查看

网友评论0