当前位置:网站首页>Xiaobai programmer day 8
Xiaobai programmer day 8
2022-07-25 22:20:00 【Too difficult L】
JD top navigation bar establishment
.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Jingdong top navigation bar </title>
<link rel="stylesheet" href="./index.css">
<style>
body{
/* Set the font */
font:12px/1.5 Microsoft YaHei,Heiti SC,tahoma,arial,Hiragino Sans GB,"\5B8B\4F53",sans-serif;
}
/* Solve the problem of high collapse */
.clearfix::before,
.clearfix::after{
content:"";
display:table;
clear:both;
}
/* Set the style of the external container */
.top-bar-wrapper{
/* Set width */
width: 100%;
/* Set height */
height: 30px;
/* Set the background color */
background-color:#e3e4e5 ;
/* Set the bottom border */
border-bottom:1px solid rgb(221,221,221);
/* Set row height , Center text vertically */
line-height: 30px;
}
/* Set the style of the inner container */
.top-bar{
/* A fixed width */
width: 1190px;
/* Set horizontal center */
margin:0 auto;
position: relative;
}
/* Set font color */
.top-bar a,
.top-bar span,
.top-bar i{
color:#999;
text-decoration:none;
}
/* Set the color of the link */
.top-bar a:hover,
.top-bar .highlight{
color:#f10215;
}
/* Set up location */
.location{
float: left;
}
/* Set city list */
.location .city-list{
display: none;
width: 320px;
height: 436px;
background-color: white;
border:1px solid rgb(204,204,204);
/* Set absolute positioning , Make it not occupy the position of the page */
position: absolute;
box-shadow:0 2px 2px rgba(0,0,0,.2);
z-index:999;
top:31px;
}
/* The right example ,hover Be sure to give the parent element */
.location:hover .city-list{
display: block;
}
/* to current-city Set margins */
.current-city{
padding:0 10px;
border:1px solid transparent;
border-bottom: none;
position: relative;
z-index: 9999;
}
/* Set up current-city The effect of moving the mouse in */
.location:hover .current-city{
background-color: white;
border:1px solid rgb(204,204,204);
border-bottom: none;
padding-bottom: 1px;
}
/* Set up location Icon Font */
.location .fas{
color:#f10215;
}
/* Set up shortcut */
.shortcut{
float: right;
}
/* Set up li */
.shortcut li{
float: left;
}
/* Set the split line */
.shortcut .line{
width: 1px;
height: 10px;
background-color: #ccc;
margin:11px 15px 0;
}
</style>
</head>
<body>
<!-- Create an external container -->
<div class="top-bar-wrapper">
<!-- Create internal container -->
<div class="top-bar clearfix">
<!-- Left menu -->
<div class="location">
<div class="current-city">
<i class="fas fa-map-marker-alt"></i>
<a href="javascript:;"> Hefei </a>
</div>
<!-- Set the drop-down box -->
<div class="city-list">
</div>
</div>
<!-- Set right menu -->
<ul class="shortcut clearfix">
<li>
<a href="javascript:;"> Hello , Please log in </a>
<a class="highlight" href="javascript:;"> Free registration </a>
</li>
<!-- Split line settings -->
<li class="line"></li>
<li><a href="#"> My order </a></li>
<li class="line"></li>
<li>
<a href="#"> My Jingdong </a>
<i class="fas fa-angle-down"></i>
</li>
<li class="line"></li>
<li><a href="#"> Jingdong member </a></li>
<li class="line"></li>
<li>
<a class="highlight" href="#"> Enterprise procurement </a>
<i class="fas fa-angle-down"></i>
</li>
<li class="line"></li>
<li>
<span> Customer service </span>
<i class="fas fa-angle-down"></i>
</li>
<li class="line"></li>
<li>
<span> Website navigation </span>
<i class="fas fa-angle-down"></i>
</li>
<li class="line"></li>
<li>
<span> Mobile Jingdong </span>
</li>
</ul>
</div>
</div>
</body>
</html>
.css
/* Remove default style */
* {
padding: 0;
margin: 0;
}
a {
text-decoration: none;
}
li{
list-style: none;
}
a:hover {
color: red !important;
}
/* Set the overall style */
#wrap {
width: 340px;
height: 350px;
/* background-color: pink; */
border-top: 3px solid #ccc;
margin: 50px auto;
}
#wrap >h2{
line-height: 2;
display: inline-block;
border-top: 3px solid red;
margin-top: -3px;
}
#wrap >h2>a{
color: black;
}
/* Set pictures */
.pic{
width: 100%;
height:165px ;
overflow: hidden;
}
.pic>img{
width: 100%;
height: 100%;
}
.pic>img:hover{
transform: scale(1.1);
}
.pic>img:hover+p{
transform: scale(1);
}
.pic>p{
/* background-color: red; */
/* background-color: rgba(0, 0, 0, .5); */
color: #fff;
margin-top: -40px;
margin-left: 30px;
}
#wrap>ul{
/* margin-left: 20px; */
margin-top: 15px;
}
#wrap>ul>li{
line-height: 2;
/* The first way to write it */
/* list-style: square;
color: #888788; */
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
/* background-color: royalblue; */
overflow: hidden;
}
#wrap>ul>li::before{
/* The second way */
content: '';
display: inline-block;
width: 5px;
height: 5px;
margin-right: 10px;
background-color:#888788 ;
}
#wrap>ul>li>a{
color: #888788;
font-size: 14px;
}
#wrap>ul>li>a:hover{
color: red;
}

边栏推荐
- Ts:typera code fragment indentation display exception (resolved) -2022.7.24
- Based on if nesting and function call
- 什么是类加载?类加载的过程?
- How is it most convenient to open an account for stock speculation? Is it safe for online account managers to open an account
- What should I do if I encounter the problem of verification code during automatic testing?
- Fill the whole square with the float property
- 手机端微信发朋友圈功能测试点总结
- Why does redis choose single thread?
- 数学规划分类 Math Programming Classfication
- 『Skywalking』. Net core fast access distributed link tracking platform
猜你喜欢
![[go basics 02] the first procedure](/img/af/f32762a828f384bf6aa063ebf959aa.png)
[go basics 02] the first procedure

The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?

Imitation Tiktok homepage interface

JMeter websocket接口测试

About vscode usage+ Solutions to the problem of tab failure

All you want to know about interface testing is here

MySQL - subquery - column subquery (multi row subquery)

Tfrecord write and read

在进行自动化测试,遇到验证码的问题,怎么办?

Wechat card issuing applet source code - automatic card issuing applet source code - with flow main function
随机推荐
[assembly language 01] basic knowledge
Some summary about function
C language: random generated number + selective sorting
What is partition and barrel division?
Solutions to the failure of win key in ikbc keyboard
The third day of Xiaobai programmer
Summary of function test points of wechat sending circle of friends on mobile terminal
3. Editors (vim)
Acwing 866. determining prime numbers by trial division
Don't vote, software testing posts are saturated
How to call the size of two numbers with a function--- Xiao Tang
Advanced database · how to add random data for data that are not in all user data - Dragonfly Q system users without avatars how to add avatar data - elegant grass technology KIR
Redis memory elimination mechanism?
The automation testing post spent 20K recruiting, but in the end, there was no suitable one. Both fresh students are better than them
The testing work is not valued. Have you changed your position?
The second short contact of gamecloud 1608
Internship: writing common tool classes
Xiaobai programmer's fourth day
Wechat applet (anti shake, throttling), which solves the problem that users keep pulling down refresh requests or clicking buttons to submit information; Get the list information and refresh the data
什么是类加载?类加载的过程?