自上週我一直在建立一個HTML網站,我一直在使用鼠標懸停,使圖像移動時,一個超鏈接將光標懸停,所以一切都顯得不錯,我主要是完成它,但有一些我不明白,我已創建3超鏈接與3鼠標懸停圖像,但最後一個實際上懸停在網站的整個頁面上。問題,鼠標懸停一整頁
我不知道爲什麼或者它確實是這樣,這就是爲什麼我在這裏問你這個問題。你可以在我的HTML看看:
.college .image {
margin-left: 100px;
margin-top: 475px;
position: absolute
}
.college .imagesecond {
transform: translate(0px, 500px);
transition: transform 0.5s ease-in-out 0.2s;
border-radius: 8px;
overflow: hidden;
}
.college:hover>.imagesecond {
transform: translate(0, -200px);
}
.lycee .image {
margin-left: 700px;
margin-top: 500px;
position: absolute
}
.lycee .imagefourth {
transform: translate(0px, 300px);
transition: transform 0.5s ease-in-out 0.2s;
border-radius: 8px;
overflow: hidden;
}
.lycee:hover>.imagefourth {
transform: translate(0, -200px);
}
.formations .image {
margin-left: 1250px;
margin-top: 510px;
overflow: hidden;
}
.formations .imagesixth {
transform: translate(0px, 400px);
transition: transform 0.5s ease-in-out 0.2s;
border-radius: 8px;
overflow: hidden
}
.formations:hover>.imagesixth {
transform: translate(0, -900px);
}
body {
background: url("http://via.placeholder.com/571x179") 33em 0% fixed no-repeat;
position: fixed;
background-color: rgb(0, 85, 170);
}
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css.css" />
<title> sainte marie </title>
</head>
<body>
<div class="saintemarie">
<a href="college/collegesaintemarie.html">
<div class="college">
<img class="image imagefirst" src="http://via.placeholder.com/196x175" />
<img class="image imagesecond" src="http://via.placeholder.com/320x440" />
</div>
</a>
<a href="lycee/lyceesaintemarie.html">
<div class="lycee">
<img class="image imagethird" src="http://via.placeholder.com/183x140" />
<img class="image imagefourth" src="http://via.placeholder.com/320x440" />
</div>
</a>
<a href="c&formation/c&fsaintemarie.html">
<div class="formations">
<img class="image imagefifth" src="http://via.placeholder.com/172x153" />
<img class="image imagesixth" src="http://via.placeholder.com/320x440" />
</div>
</a>
</div>
</body>
</html>
你有什麼想法,可以幫助我嗎?或者改進我迄今爲止所做的代碼行?萬分感謝!
嘿souzouker,下次請大家多一點關注你的寫作(大小寫),並使用編輯器按鈕來打開你的代碼堆棧段,這樣我們就可以很容易地重現您的問題。這將幫助我們幫助你。順便說一下,我看到的只有藍色。您應該用[佔位符圖片](https://placeholder.com/)替換圖片的src。我會這樣做,但是你沒有爲你的圖像指定'width'或'height'(你應該)。 – domsson
我認爲它的所有藍色,因爲我使用我的電腦中的文件和圖像,我可以嘗試改變它佔位符圖像給我一分鐘請 – souzouker
我認爲它的工作,你可以看到它在整個頁面上是如何工作的,你可以看到第3圖像盤旋在整個頁面execpt 2個orther超鏈接 – souzouker