IT/css

css 툴팁

조원태 2017. 6. 13. 00:11
반응형

기본 툴팁

 

사용자가 요소 위에서 마우스를 움직일 때 나타나는 툴팁을 생성하십시오 :

 

<style>

/* 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: black;

    color: #fff;

    text-align: center;

    padding: 5px 0;

    border-radius: 6px;

 

    /* Position the tooltip text - see examples below! */

    position: absolute;

    z-index: 1;

}

 

/* Show the tooltip text when you mouse over the tooltip container */

.tooltip:hover .tooltiptext {

    visibility: visible;

}

</style>

 

<div class="tooltip">Hover over me

  <span class="tooltiptext">Tooltip text</span>

</div>



반응형

'IT > css' 카테고리의 다른 글

css3 여러 배경 이미지의 크기 정의  (0) 2017.08.06
css 이미지 갤러리  (0) 2017.06.13
css 드롭 다운  (0) 2017.06.13
css 수직 탐색 막대 예제  (0) 2017.06.08
css Vertical Navigation Bar  (0) 2017.06.08