<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>마우스 호버되면 나타나는 툴팁 만들기</title>
<style>
.items {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.item {
/* border: 1px solid black; */
text-align: center;
position: relative;
}
.item p {
width: 250px;
margin: 0 0 15px;
padding: 15px;
background-color: black;
color: white;
opacity: 0;
transition: 0.5s;
}
.item p::after {
content: ' ';
display: block;
width: 15px;
height: 15px;
background-color: black;
position: absolute;
left: 50%;
transform: translateX(-50%) rotate(45deg);
top: 30%;
}
.item:hover p {
opacity: 1;
}
</style>
</head>
<body>
<div class="items">
<div class="item">
<p>
This HTML tutorial contains hundreds of HTML examples.
</p>
<img src="./image/icon-01.png" alt="">
</div>
<div class="item">
<p>
This CSS tutorial contains hundreds of CSS examples. </p>
<img src="./image/icon-02.png" alt="">
</div>
<div class="item">
<p>
AngularJS extends HTML with new attributes. </p>
<img src="./image/icon-03.png" alt="">
</div>
<div class="item">
<p>
Node.js is an open source server environment. </p>
<img src="./image/icon-04.png" alt="">
</div>
</div>
</body>
</html>
영상 따라보기전에 혼자서 먼저 해봤는데 이렇게 했을경우에는
이미지만 클릭하였 떄 툴팁이 나오게하는 방법은 없는건가요 ?ㅠ
조금만 다르게해도 너무 헷갈리네요...