https://jsfiddle.net/minsupkr/9w6L5bua/ jQuery
https://jsfiddle.net/minsupkr/9w6L5bua/1/ CSS
html
[code]<div>
<label for="inp">댓글을 입력하세요</label>
<input type="text" id="inp">
</div>[/code]
css
[code]div {position:relative}
div:after {z-index:999;position:absolute;bottom:0;left:50%;width:0;height:0;background:#333;content:'';
-webkit-transition:all 0.2s ease-out;
transition:all 0.2s ease-out
}
.on:after {bottom:-1px;left:0;width:100%;height:2px}
div label {position:absolute;top:0;left:0}
.on label {color:#ccc}
input {width:100%;border:0;border-bottom:1px solid #ccc;background:transparent;outline:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}[/code]
javascript
[code]$(function(){
$("input").on("focus", function(){
$(this).closest("div").addClass("on");
});
$("input").on("blur", function(){
$(this).closest("div").removeClass("on");
});
});[/code]
유튜브 보다가 댓글란이 재밌어 보여서 빠르고 조잡하게 한번 짜봤습니다.
좀 다듬으면 쓸만하지 않을까요... ㅎㅎㅎ;;
팁자료실은 신택스하이라이트가 안 먹는군요.
@리자 @thisgun 멘션도 안 되는군요. ㅎㅎㅎ
게시글 목록
| 번호 | 제목 |
|---|---|
| 3530 | |
| 3529 | |
| 3497 | |
| 3472 | |
| 3471 |
CSS
CSS 그리드 관련 사이트
9
|
| 3451 | |
| 3442 | |
| 3441 | |
| 3437 |
CSS
마진병합 현상
6
|
| 3436 | |
| 3425 |
기타
제이쿼리 버전
1
|
| 3421 | |
| 3420 | |
| 3405 | |
| 3402 | |
| 3399 | |
| 3397 | |
| 3394 |
기타
“Barba.js
1
|
| 3393 | |
| 3392 | |
| 3391 | |
| 3390 | |
| 3389 | |
| 3388 | |
| 3387 | |
| 3386 | |
| 3385 | |
| 3384 | |
| 3383 | |
| 3382 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기