<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="2.css"/>
</head>
<body>
<a href="http://www.taobao.com">淘宝网</a>
</body>
</html>
方式一:
a{
display: inline-block;
width: 200px;
height: 76px;
text-decoration: none;
color: firebrick;
border: black 1px solid;
background-image: url(1572809375526-200-76.png);
background-size: 200px 76px;
text-indent: 210px;
white-space: nowrap;
overflow: hidden;
}
方式二:
a{
display: inline-block;
width: 200px;
height: 0px;
text-decoration: none;
padding-top: 76px;
color: firebrick;
border: black 1px solid;
background-image: url(1572809375526-200-76.png);
background-size: 200px 76px;
overflow: hidden;
}
去掉css后:
依然能显示出HTML部分,依然能点击链接进入。