网页概览鼠标经过时
鼠标不经过时
代码如下
<!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>3彩导航</title>
<style>
.nav a {
display: inline-block;
width: 200px;
height: 90px;
background-color: purple;
line-height: 80px;
text-align: center;
background-image: url(2xiaotu.PNG);
background-repeat: no-repeat;
text-decoration: none;
}
.nav a:hover {
background-image: url(3xiaotu.PNG);
}
</style>
</head>
<body>
<div class="nav">
<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 http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>背景位置</title>
<style>
h3 {
width: 200px;
height: 40px;
background-color: pink;
font-size: 14px;
font-weight: 400;
line-height: 40px;
background-image: url(xiaotu.PNG);
background-repeat: no-repeat;
background-position: left center;
text-indent: 3.5em;
}
</style>
</head>
<body>
<h3>成长守护平台</h3>
</body>
</html>