css 툴팁 만들기
<style>
.center {
text-align:center;
margin-top:200px;
}
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 100%;
left: 50%;
margin-left: -60px;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
.tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
</style>
<body>
<div class="center">
<div class="tooltip" >Hello World!
<span class="tooltiptext">this is tooltip!</span>
</div>
</div>
</body>
'IT > css' 카테고리의 다른 글
CSS를 삽입하는 3 가지 방법 (0) | 2016.12.19 |
---|---|
CSS 코멘트 삽입 (0) | 2016.12.19 |
CSS 구문 강좌 (0) | 2016.12.19 |
레이아웃 없는 이미지 롤오버 테두리 (0) | 2016.11.13 |
css 높이 100 수직정렬 줄바꿈 페이지 넘김 수평정렬 FF 스크롤바 파이어폭스 (0) | 2016.11.13 |