방법 - 도구 설명
CSS로 툴팁을 만드는 방법을 알아보세요.
아래 텍스트 위로 마우스를 가져갑니다.
맨 위
툴팁 텍스트
오른쪽
툴팁 텍스트
맨 아래
툴팁 텍스트
왼쪽
툴팁 텍스트
도구 설명을 만드는 방법
1단계) HTML 추가:
예시
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip
text</span>
</div>
2단계) CSS 추가:
예시
/* Tooltip container */
.tooltip {
position:
relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable
text */
}
/* Tooltip text */
.tooltip .tooltiptext
{
visibility: hidden;
width:
120px;
background-color: #555;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text */
position: absolute;
z-index: 1;
bottom: 125%;
left:
50%;
margin-left: -60px;
/*
Fade in tooltip */
opacity: 0;
transition: opacity 0.3s;
}
/* Tooltip arrow */
.tooltip .tooltiptext::after
{
content: "";
position:
absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent
transparent transparent;
}
/* Show the tooltip text when
you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
팁: 도구 설명 에 대해 자세히 알아보려면 CSS 도구 설명 자습서 로 이동하십시오 .
팁: "클릭 가능한" 툴팁 을 생성하려면 팝업 생성 방법 튜토리얼 로 이동하십시오.
팁: 모달은 툴팁과도 유사합니다. 모달에 대해 배우 려면 모달을 만드는 방법 자습서 로 이동 하십시오 .