[英]How do I make my image change to another image on hover
誰能幫我嗎 ? 我試圖讓我的標志在懸停時變成另一個圖像。
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="styles/base.css"/>
<link rel="stylesheet" href="styles/modele01.css"/>
<link rel="shortcut icon" href="./images/favicon.ico" >
<title> Look At Them Cars </title>
<style type='text/css'>
img {
background-image: url('./images/LogoSite.png');
}
img:hover {
background-image: url('./images/LogoBleu.png');
}
</style>
</head>
<body>
<div id="titre" class="slide header">
<h1><a href="index.html"><img src="./images/LogoSite.png"></a></h1>
<br></br>
<div id="liste">
<a href="Lexus">Lexus</a>
<a href="Porsche">Porsche</a>
<a href="Toyota">Toyota</a>
<a href="Crédits">Crédits</a>
</div>
</div>
我一直在嘗試在我的 css img:hover 中使用我想要更改的背景圖像做一個類。 它沒有用
使用背景圖像屬性方法,在 html 頁面頂部的 head 標記中嘗試此操作:
<style type='text/css'>
img {
background-image: url('firstimage.png');
}
img:hover {
background-image: url('second.png');
}
</style>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.