Java教程

美妆手机导航栏(案例)

本文主要是介绍美妆手机导航栏(案例),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./css/style.css" />
  </head>
  <style>
    * {
      list-style: none;
      margin: 0;
      padding: 0;
      text-decoration: none;
    }
  </style>
  <body>
    <!-- 外部容器 -->
    <div class="top-bar">
      <!-- 左侧菜单 -->
      <div class="left-menu">
        <!--菜单图标 -->
        <div class="menu-icon"></div>
          <li class="li1" id="lia"></li>
          <li class="li2" id="lia"></li>
          <li class="li3" id="lia"></li>
        </ul>
        <!-- 创建菜单 -->
        <ul class="naw">
          <li class="li4"><a href="#">手机</a></li>
          <hr />
          <li class="li5"><a href="#">美容仪器</a></li>
          <hr />
          <li class="li6"><a href="#">配件</a></li>
          <hr />
          <li class="li7"><a href="#">服务支持</a></li>
          <hr />
          <li class="li8"><a href="#">企业网站</a></li>
          <li>
            <a href="#"><img src="/img/wu.png" /></a>
            <apan>搜索 Meitu.com</apan>
          </li>
        </ul>
      </div>
      <!-- logo -->
      <h1 class="logo">
        <a href="/" style="color: aliceblue; ">美图手机</a>
      </h1>
      <!-- 用户信息 -->
      <div class="user-info">
        <a href="#">
          <img src="/img/si.png"  />
        </a>
      </div>
    </div>
  </body>
</html>
/* 导航条的外部容器 */
.top-bar {
  height: 48px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  background-color: black;
  display: flex;
}

/* 设置左侧导航图标 */
.left-menu {
  width: 18px;
  height: 48px;
  background-color: aliceblue;
}
.menu-icon {
  background-color: black;
  width: 18px;
  height: 48px;
  /* position: relative; */
}
a {
  color: white;
  margin-left: 50px;
}
#lia {
  width: 18px;
  height: 5px;
  background-color: #ffffff;
  position: absolute;
  /* 修改原焦点 */
  transform-origin: left center;
  transition: 0.2s;
}
.li1 {
  top: 18px;
}
.li2 {
  top: 24px;
}
.li3 {
  top: 30px;
}
.li1:hover {
  /* 向下旋转 */
  transform: rotateZ(40deg);
}
.li2:hover {
  /* 隐藏 */
  opacity: 0;
}
.li3:hover {
  transform: rotateZ(-40deg);
}
.naw {
  display: none;
  position: absolute;
  top: 48px;
  left: 0;
  bottom: 0;
  background-color: black;
  width: 100%;
}
.user-info {
  border: 5px red solid;
}
li {
  margin-bottom: 20px;
}
.logo {
  margin: 0 auto;
}
/* 设置媒体查询 */
@media only screen {
  /* 断点 768*/
  @media (max-width: 768px) {
    .left-menu {
      order: 2;
    }
    .logo {
      order: 1;
    }
    .user-info {
      order: 3;
    }
  }
}

 

这篇关于美妆手机导航栏(案例)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!