私はウェブサイトを作ろうとしていますが、私はここで立ち往生しています。これは私がマウスのホバーに移動するには、小さな花の画像を作りたい、これまでマウスホバーでマウスと画像をやりとりする方法は?
body,
html {
margin: 0;
}
/*Container*/
.container {
max-width: 1349px;
margin: auto
}
.hero-image {
background-image: url(https://www.w3schools.com/css/img_flwr.gif), url("https://www.w3schools.com/howto/photographer.jpg");
height: 350px;
background-position: right bottom, center;
background-repeat: no-repeat, no-repeat;
background-size: 160px, cover;
position: relative;
}
.hero-text {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
.hero-text h1 {
font-size: 5vw;
}
.hero-text button {
border: none;
outline: 0;
display: inline-block;
padding: 10px 25px;
color: black;
background-color: #ddd;
text-align: center;
cursor: pointer;
}
.hero-text button:hover {
background-color: #555;
color: white;
}
<div class="container">
<div class="hero-image">
<div class="hero-text">
<h1>I am John Doe</h1>
<p>And I'm a Photographer</p>
<button>Hire me</button>
</div>
</div>
<p>Page Content..</p>
</div>
を作ったものですが、私はそれがでそれをしないこのウェブサイトzooskopje.com.mkと同じマウスと対話したいですスライダにポップアップ表示される画像。ありがとう。
cssで 'transform:translate'を見てください。期待される結果を得るためにJSも使用する必要があります –
ようこそスタックオーバーフロー。投稿のガイドラインを読んでください。 – catbadger