原神官网HTML+CSS

 这个网页大量运用了flex布局,并且能够自适应屏幕宽度

下面是HTML代码





    
    
    
    原神
    
    
    



    
    
    

新闻资讯

下面是CSS样式文件

body {
  min-width: 1200px;
}
.nuxt {
  width: 100vw;
  height: 100vh;
  min-width: 1200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.nuxt .video-bg {
  position: absolute;
  top: 0;
  z-index: -1;
  height: 100vh;
  min-width: 800px;
  overflow: hidden;
  width: 100%;
}
.nuxt .video-bg video {
  min-width: 1000px;
  width: 100%;
  transform: translateY(-46px);
}
.nuxt .headers {
  background-color: rgba(0, 0, 0, 0.5);
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
}
.nuxt .headers > a {
  display: flex;
  align-items: center;
  width: 317px;
  height: 66px;
  background: url(../images/logo.png);
  margin-left: 8px;
}
.nuxt .headers > a::before {
  content: '';
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url(../images/音乐.png);
  background-size: 30px;
  margin-left: 61px;
  text-align: center;
}
.nuxt .headers ul {
  flex: 5;
  display: flex;
  height: 66px;
  align-items: center;
  margin-left: -40px;
}
.nuxt .headers ul li {
  height: 100%;
  text-align: center;
}
.nuxt .headers ul li a {
  position: relative;
  display: inline-block;
  line-height: 66px;
  height: 100%;
  text-align: center;
  margin: 0 30px;
  font-size: 17px;
  color: #ccc;
}
.nuxt .headers ul li a::before {
  content: '';
  position: absolute;
  width: 0;
  height: 5px;
  background-color: #69e0ff;
  transition: all 0.4s;
}
.nuxt .headers ul li a:hover {
  text-shadow: 0 0 10px #69e0ff, 0 0 20px #69e0ff, 0 0 40px #69e0ff;
  color: #fff;
}
.nuxt .headers ul li a:hover::before {
  display: block;
  width: 100%;
}
.nuxt .header-right {
  margin-right: 20px;
  display: flex;
  align-items: center;
}
.nuxt .header-right a {
  display: inline-block;
  color: #ccc;
  font-size: 17px;
  margin-right: 30px;
  margin-top: 2px;
}
.nuxt .header-right a::after {
  content: '';
  display: inline-block;
  width: 27px;
  height: 27px;
  background: url(../images/爱心.png);
  background-size: 27px;
  vertical-align: middle;
  margin-left: 15px;
}
.nuxt .poster-sign {
  flex: 0.3;
  width: 100%;
  height: 745px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.nuxt .poster-sign .positer-video {
  background-color: pink;
  width: 356px;
  height: 76px;
  background: url(../images/播放-bg.png);
}
.nuxt .poster-sign .positer-video button {
  display: block;
  position: relative;
  margin: 14px auto 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0px;
}
.nuxt .poster-sign .positer-video button:hover {
  background-color: transparent;
}
.nuxt .poster-sign .positer-video button:hover::before {
  background: url(../images/bofang.png) no-repeat 0px -28px;
}
.nuxt .poster-sign .positer-video button::before {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  background: url(../images/bofang.png) no-repeat;
}
.nuxt .poster-sign .download {
  width: 540px;
  height: 125px;
  display: flex;
  align-items: center;
}
.nuxt .poster-sign .download .box-download {
  display: flex;
}
.nuxt .poster-sign .download .box-download .download-er {
  margin: 6px 0;
  position: relative;
  width: 102px;
  height: 102px;
  background: url(../images/二维码.png);
  background-size: 102px;
}
.nuxt .poster-sign .download .box-download .download-er img {
  width: 30px;
  height: 30px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -15px;
  margin-left: -15px;
  border-radius: 3px;
}
.download-app {
  display: flex;
  flex-direction: column;
}
.download-tap {
  display: flex;
  flex-direction: column;
}
.box-download a img:hover {
  box-shadow: 1px 1px 20px 1px;
}
@keyframes arrow {
  50% {
    opacity: 0;
  }
}
div [class^=arrow-] {
  background: url(../images/xia.png) no-repeat;
  width: 25px;
  height: 15px;
  animation: arrow 1.5s infinite linear;
}
div .arrow-1 {
  animation-delay: 0.2s;
}
div .arrow-2 {
  animation-delay: 0.5s;
}
div .arrow-3 {
  animation-delay: 0.8s;
}
.positer-bages {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 100px;
  height: 129px;
}
.positer-bages img {
  width: 100%;
  height: 100%;
}
@keyframes move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-1920px);
  }
}
section {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 910px;
  background: url(../images/bg2.jpg) no-repeat;
  background-size: 100% 100%;
}
section h1 {
  position: relative;
  margin: 183px auto 60px;
  font-size: 50px;
  width: 200px;
  color: #fff;
  font-weight: 400;
}
section h1::after {
  position: absolute;
  top: 30px;
  left: -354px;
  display: inline-block;
  content: '';
  width: 385px;
  height: 14px;
  background: url(../images/chang.png) no-repeat;
}
section h1::before {
  position: absolute;
  top: 30px;
  left: 163px;
  display: inline-block;
  content: '';
  width: 385px;
  height: 14px;
  transform: rotateY(180deg);
  background: url(../images/chang.png) no-repeat;
}
section .lunbotu {
  position: relative;
  width: 640px;
  height: 400px;
  overflow: hidden;
}
section .lunbotu .img {
  height: 402px;
  width: 2560px;
  animation: move 6s infinite steps(3);
}
section .lunbotu .img img {
  float: left;
  height: 100%;
}
section .news {
  position: relative;
  background-color: rgba(38, 18, 12, 0.62);
  width: 640px;
  height: 400px;
}
section .news > a {
  position: absolute;
  right: 33px;
  bottom: 30px;
  height: 22px;
  line-height: 22px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding-left: 38px;
  background: url(../images/十字.png) no-repeat left center / 22px;
}
section .news > a:hover {
  color: rgba(255, 212, 159, 0.75);
  background-image: url(../images/si.png);
}
section .title-tab {
  margin: 35px 24px 0;
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
  width: 592px;
  height: 39px;
  transition: all 0.4s;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}
section .title-tab li {
  padding: 0 19px 12px;
  font-size: 18px;
  color: #fff;
  position: relative;
}
section .title-tab li:hover {
  color: #ffd49f;
  border-bottom: 2px solid #ffd49f;
}
section .content-tab {
  width: 592px;
  height: 260px;
  margin: 0 auto;
}
section .content-tab li {
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
  width: 592px;
}
section .content-tab li:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
section .content-tab li a {
  display: inline-block;
  flex: 5;
  height: 52px;
  line-height: 52px;
  font-size: 16px;
  color: #fff;
  padding-left: 11px;
}
section .content-tab li p {
  display: inline-block;
  color: rgba(255, 255, 255, 0.35);
}
.auto {
  display: flex;
  justify-content: center;
}
.city ul {
  overflow: hidden;
}
.city ul li {
  transform-style: preserve-3d;
  position: relative;
  width: 100%;
  height: 260px;
  z-index: 10;
  background: center no-repeat;
  background-size: 100% auto;
  cursor: pointer;
  overflow: hidden;
}
.city ul li::before {
  position: absolute;
  content: '';
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 260px;
  z-index: 1;
}
.city ul li:hover::before {
  background-color: rgba(0, 0, 0, 0.2);
}
.city ul li:hover .city-list-bg {
  transform: scale(1.05);
  border: 10px solid #fff;
}
.city ul li:hover a p::before {
  display: block;
}
.city ul li .city-list-bg {
  width: 100vw;
  height: 100%;
  background: url(../images/蒙德城.jpg) no-repeat;
  background-size: 100% 100%;
  position: absolute;
  transition: transform 0.4s 0s ease-out;
  box-sizing: border-box;
  overflow: hidden;
}
.city ul li:hover .list-char {
  opacity: 1;
}
.city ul li .list-char {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  display: block;
  content: '';
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: calc(50% + 360px) 50%;
  background-size: 960px 260px;
  opacity: 0;
  transition: all 0.2s 0s ease-in;
  border: #fff solid 6px;
  box-sizing: border-box;
  background-image: url(../images/人物.png);
}
.city ul li a {
  display: block;
  height: 100%;
  position: relative;
  z-index: 3;
  width: 100%;
  height: 260px;
}
.city ul li a p {
  display: inline-block;
  position: relative;
  z-index: 3;
  font-size: 36px;
  color: #fff;
  line-height: 260px;
  width: 100%;
  height: 260px;
  background: url(../images/撑起.png) no-repeat center;
  background-size: 132px;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  margin: 0 !important;
  overflow: hidden;
}
.city ul li a p::before {
  position: absolute;
  bottom: 91px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  content: '';
  width: 210px;
  height: 10px;
  background: url(../images/xia边.png) center no-repeat;
  background-size: 210px 10px;
}
.city ul li:nth-child(2) .city-list-bg {
  background: url(../images/bg22.jpg) no-repeat;
  background-size: 100% 100%;
}
.city ul li:nth-child(3) .city-list-bg {
  background: url(../images/办公3.jpg) no-repeat;
  background-size: 100% 100%;
}
.city ul li:nth-child(4) .city-list-bg {
  background: url(../images/bg44.jpg) no-repeat;
  background-size: 100% 100%;
}
.city ul li:nth-child(5) .city-list-bg {
  background: url(../images/hei.jpg) no-repeat;
  background-size: 100% 100%;
}
.city ul li:nth-child(2) .list-char {
  background-image: url(../images/人物2.png);
}
.city ul li:nth-child(3) .list-char {
  background-image: url(../images/人物3.png);
}
.city ul li:nth-child(4) .list-char {
  background-image: url(../images/人物4.png);
}
.city ul li:nth-child(5)::before {
  display: none;
}
.city ul li:nth-child(5) p::before {
  background-image: none;
}
footer {
  width: 100%;
  height: 430px;
  background-color: #ffd49f;
  padding: 0 0 35px;
}
footer .footer {
  width: 100%;
  height: 343px;
  padding: 30px 0 20px;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}
footer .footer .footer-logo {
  width: 300px;
  height: 293px;
  display: flex;
  align-items: center;
}
footer .footer .footer-logo div {
  width: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
}
footer .footer .footer-logo div img {
  width: 120px;
  height: 42px;
}
footer .footer .footer-logo div img:nth-of-type(2) {
  width: 110px;
  height: 80px;
}
footer .footer .footer-logo div span {
  background-color: #fff;
  width: 1px;
  height: 28px;
  margin: 0 25px;
}
footer .footer .info {
  width: 882px;
  height: 293px;
  margin-left: 60px;
}
footer .footer .info .icon {
  width: 800px;
  height: 76px;
  padding: 10px 0;
}
footer .footer .info .icon a {
  display: inline-block;
  width: 116px;
  height: 48px;
  background: url(../images/1.png) no-repeat;
}
footer .footer .info p {
  color: #999;
  height: 21px;
  font-size: 14px;
}
footer .footer .info .link {
  display: block;
  width: 882px;
  height: 52px;
  color: #fff;
  font-size: 14px;
  padding-bottom: 30px;
}
footer .footer .info .link div {
  width: 882px;
  height: 52px;
}
footer > ul {
  width: 100%;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #111111;
}
footer > ul .wrap-lap {
  position: relative;
}
footer > ul .wrap-lap:hover .share {
  display: block;
}
footer > ul .wrap-lap .share {
  display: none;
  position: absolute;
  right: -6px;
  bottom: 0;
  width: 304px;
  height: 120px;
  border-radius: 6px;
  background: #3d3d3d;
  text-align: center;
  transform: translateY(142px);
  transform-origin: top;
}
footer > ul .wrap-lap .share P {
  height: 46px;
  line-height: 46px;
  color: #fff;
  font-size: 18px;
}
footer > ul .wrap-lap .share ul {
  width: 100%;
  height: 44px;
  display: flex;
  justify-content: center;
}
footer > ul .wrap-lap .share ul li {
  width: 44px;
  height: 44px;
  margin-right: 20px;
  background: url(../images/10049.png) no-repeat -7px -108px;
  background-size: 213px;
}
footer > ul .wrap-lap .share::before {
  position: absolute;
  top: -18px;
  right: 11px;
  width: 0;
  height: 0;
  display: block;
  border: 10px solid transparent;
  border-bottom: 10px solid #3d3d3d;
}
footer > ul > li {
  width: 32px;
  height: 32px;
  margin-right: 32px;
  cursor: pointer;
  background: url(../images/10049.png) no-repeat -7px -7px;
  background-size: 186px;
}
footer > ul > li:hover {
  background: url(../images/10049.png) no-repeat -54px -7px;
  background-size: 186px;
}
.social {
  position: fixed;
  right: 0px;
  top: 300px;
  background-color: #fff;
  width: 178px;
  height: 409px;
  z-index: 20;
}
.social ul {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 178px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 2px 10px;
}
.social ul li {
  width: 174px;
  height: 44px;
}
.social ul li a::before {
  content: '\e626';
  margin-right: 20px;
  margin-left: 30px;
  font-family: 'iconfont';
  font-size: 30px;
  vertical-align: middle;
}
.social ul li:nth-child(1) {
  width: 174px;
  height: 267px;
}
.social ul li:nth-child(1) a {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.social ul li:nth-child(1) a::before {
  content: '';
  width: 0;
  height: 0;
}
.social ul li:nth-child(1) a p:nth-child(1) {
  margin: 18px auto 27px;
  display: block;
  width: 72px;
  height: 24px;
}
.social ul li:nth-child(1) a img {
  text-align: center;
  width: 147px;
  height: 147px;
}
.HEI:hover {
  background-color: #000;
}
.HEI:hover a {
  color: #ffd49f;
}

你可能感兴趣的:(网页,css,html,前端)