코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>CSS Tooltips</title> <style> body { text-align: center; } .tooltip { position: relative; display: inline-block; margin: auto; } .tooltip .tooltip-content { visibility: hidden; width: 220px; background-color: orange; padding: 0; color: white; text-align: center; position: absolute; z-index: 1; bottom: 180%; left: 50%; margin-left: -110px; } .tooltip .tooltip-content::after { content: " "; position: absolute; top: 100%; left: 50%; margin-left: -10px; border-width: 10px; border-style: solid; border-color: orange transparent transparent transparent; } .tooltip:hover .tooltip-content { visibility: visible; } </style> </head> <body> <h1>툴팁의 모양 변경</h1> <br><br><br> <div class="tooltip"> <span>여기에 마우스를 올려보세요!</span> <div class="tooltip-content"> <p>위쪽에 나타나는 툴팁입니다!</p> </div> </div> </body> </html>