CSS로 마우스 오버 시 요소를 표시하려면 코드는 다음과 같습니다. −
예시
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin:20px;
padding:20px;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.hiddenText {
display: none;
}
.hoverDiv:hover + .hiddenText {
display: block;
color: rgb(71, 0, 65);
font-size: 22px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Display an Element on Hover Example</h1>
<div class="hoverDiv" style="font-size: 18px;">Hover over me.</div>
<div class="hiddenText">This text is shown by hovering on the above div</div>
</body>
</html> 출력
위의 코드는 다음 출력을 생성합니다 -

"Hover over me" 텍스트 위로 마우스를 가져갈 때 -
