代码如下:
<!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>
<style>
.box{
width: 85px;
height: 45px;
background-color: coral;
list-style: none;
display: inline-block;
line-height: 50px;
padding: 10px 30px;
}
.box:hover{
background:black;
color:white;
}
ol{
text-align: center;
padding: 0px;
}
</style>
</head>
<body>
<ol>
<li class="box">百度</li>
<li class="box">新浪</li>
<li class="box">火狐</li>
<li class="box">淘宝</li>
<li class="box">京东</li>
<li class="box">阿里巴巴</li>
</ol>
</body>
</html>