티스토리 뷰
728x90
반응형
tooltip( 말풍선 ) CSS
HTML Element의 속성 값을 활용하여 별도의 js없이 HTML/CSS로만 tooltip( 말풍선 ) 만들기.
- 이전 포스트의 "tooltip( 말풍선 ) CSS (1)" 보단 좀더 활용도가 있을 듯 싶다.
HTML
<!-- 버튼 엘리먼트 -->
<a href="#" class="bt-tooltip" data-title="댓글달기">댓글달기</a>
CSS
/* 툴팁 balloon */
.bt-tooltip {
position: relative;
display:inline-block;
}
.bt-tooltip:hover[data-title]:before,
.bt-tooltip:hover[data-title]:after {
visibility: visible;
pointer-events: auto
}
.bt-tooltip[data-title]:before,
.bt-tooltip[data-title]:after {
pointer-events: none;
visibility: hidden;
}
.bt-tooltip[data-title]:before{
content: '';
position: absolute;
top: auto;
right: auto;
bottom: 100%;
left: 50%;
font-size: 1rem;
width: .71428571em;
height: .71428571em;
background: #fff;
-webkit-transform: rotate(45deg) translateX(-50%);
transform: rotate(45deg) translateX(-50%);
z-index: 2;
-webkit-box-shadow: 1px 1px 0 0 #bababc;
box-shadow: 1px 1px 0 0 #bababc;
}
.bt-tooltip[data-title]:after {
content: attr(data-title);
position: absolute;
top: auto;
right: auto;
left: 50%;
bottom: 100%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
margin-bottom: .5em;
text-transform: none;
text-align: left;
white-space: nowrap;
font-size: 1rem;
border: 1px solid #d4d4d5;
line-height: 1.4285em;
max-width: none;
background: #fff;
padding: .633em 1em;
font-weight: 400;
font-style: normal;
color: rgba(0,0,0,.87);
border-radius: .48571429rem;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12), 0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0 rgba(34,36,38,.12), 0 2px 10px 0 rgba(34,36,38,.15);
z-index: 1;
}
728x90
반응형
'Programming language > HTML & CSS' 카테고리의 다른 글
하위 엘리먼트 존재 유무 체크 css (0) | 2018.11.23 |
---|---|
모바일 토글 스타일 버튼( switch button ) (0) | 2018.11.07 |
tooltip( 말풍선 ) CSS (1) (0) | 2018.07.12 |
FOUC 현상 (0) | 2017.09.15 |
화면에 width/height 100%로 채우기 css (0) | 2017.08.11 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- svg 폰트
- vue-router
- Intrinsic
- icon font
- IntrinsicElements
- svg모션
- anime.js
- 반복문
- CSS
- JsDoc
- git checkout -b
- for of 구문
- react
- Aptana
- 앵귤러
- RefreshToken
- git
- 코도바
- 자바스크립트
- React.StrictMode
- 리프래시토큰
- 내장요소
- Vue3
- cordova
- react-router-dom
- 태그
- Angular
- 아이콘 폰트 만들기
- svg icon font
- interceptors
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
글 보관함