需要用到的辅助工具是 像素尺子和截图工具 snipaste。
使用snipaste不仅可以截图,还可以吸取颜色值。按住alt键即可。
<!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>
</head>
<body>
<a href="#">手机</a>
<a href="#">电视</a>
<a href="#">笔记本 平板</a>
<a href="#">家电</a>
<a href="#">出行 穿戴</a>
<a href="#">智能 路由器</a>
<a href="#">电源 配件</a>
<a href="#">健康 儿童</a>
<a href="#">耳机 音箱</a>
<a href="#">生活 箱包</a>
</body>
<style>
a {
background-color: #a19e9e;
color: white;
height: 42px;
width: 234px;
display: block;
text-decoration: none;
text-indent: 2em;
line-height: 42px;
}
a:hover {
background-color: #ff6700;
}
</style>
</html>
PS:实现单行文字垂直居中
让文字的行高(line-height)等于盒子的高度(height),就可以让文字在当前盒子中垂直居中。