首页htmlaHTML Element Style - 如何添加背景图像到锚点

HTML Element Style - 如何添加背景图像到锚点

我们想知道如何添加背景图像到锚点。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#temp {
  display: inline-block;
  background-image: url('http://www.w3cschool.cn/style/download.png');
  width: 32px;
  height: 32px;
}
</style>
</head>
<body>
  <a href='#' id='temp'></a>
  <img src='http://www.w3cschool.cn/style/download.png' />
</body>
</html>