- 小米商城侧边栏:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
background-color: gray;
width: 300px;
height: 420px;
}
a {
color: white;
font-size: 1.5em;
display: block;
text-decoration: none;
width: 300px;
height: 60px;
/* text-align: center; */
text-indent: 2em;
line-height: 60px; /*让行高等于小盒子的高度 可以实现垂直居中*/
}
a:hover {
background-color: orange;
}
</style>
</head>
<body>
<div>
<a href="#">手机 电话卡</a>
<a href="#">电视 盒子</a>
<a href="#">笔记本 平板</a>
<a href="#">出行 穿戴</a>
<a href="#">智能 路由器</a>
<a href="#">健康 儿童</a>
<a href="#">耳机 音箱</a>
</div>
</body>
</html>
效果:
- 新浪首页栏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
height: 80px;
background-color: white;
font-size: 2em;
border-top: 1px solid orange;
border-bottom: 1px solid gray;
}
div a {
display: inline-block;
padding: 20px;
text-decoration: none;
color: black;
}
div a:hover {
color: orange;
background-color: #eeedf0;
}
</style>
</head>
<body>
<div>
<a href="#">新浪导航</a>
<a href="#">手机新浪网</a>
<a href="#">移动客户端</a>
<a href="#">微博</a>
<a href="https://www.youkuaiyun.com/">优快云</a>
</div>
</body>
</html>
效果:
下拉表单:select
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
省份:
<select>
<option>河南</option>
<option>黑龙江</option>
<option>江西</option>
<option>广东</option>
<option>河北</option>
</select>
</body>
</html>
实现效果: