도

input style로 이미지 버튼 만드는건 무린가요;;?

질문이라 죄송합니다;;;;

input style 태그로 bg로 이미지를 하나 넣어놓고, 마우스 over했을때 다른이미지가 나오게끔 버튼형식을 만들순없을까요? onfocus를 보다가 생각이 나서;;; 아직 초보라 진도가 안나가네요 ㅠ;;
아시는분 이게 가능한걸까요 ㅎ;?

|

댓글 5개

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>over image on input stly</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
body{
font-size:63%;
color:#000;
}
/*input*/
.input_on{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #999;
background:url(http://www.google.com/images/nav_logo36.png) no-repeat;
}
.input_off{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #CCC;
background-color:#FFF;
}
.input_move{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #999;
background:url(http://www.google.com/images/nav_logo36.png) no-repeat;
}
.input_out{
/*height:16px;기본높이*/
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #CCC;
background-color:#FFF;
}
/*form*/
ul.input_test{
margin:20px auto 0 auto;
width:500px;
list-style-type:none;
}
ul.input_test li{
width:500px;
height:22px;
margin-bottom:10px;
}
.input_test label{
float:left;
padding-right:10px;
width:100px;
line-height:22px;
text-align:right;
font-size:1.4em;
}
.input_test p{
float:left;
_margin-top:-1px;
}
.input_test span{
float:left;
padding-left:10px;
line-height:22px;
text-align:left;
font-size:1.2em;
color:#999;
}
</style>
</head>
<body>
<ul class="input_test">
<li>
<label for="inp_name">이름:</label>
<p><input id="inp_name" class="input_out" name="" type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" /></p>
<span>ex) 홍 길 똥?</span>
</li>
<li>
<label for="inp_email">Email:</label>
<p><input id="inp_email" class="input_out" name="" type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" /></p>
<span>ex) [email protected]</span>
</li>
<li>
<label for="inp_web">home:</label>
<p><input id="inp_web" class="input_out" name="" type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" /></p>
<span>ex) test.com</span>
</li>
</ul>

</body>
</html>
一現 님의 아주 명확한 답변. 친절한 쏘스... 와우~
근데 제생각은 기본적으로 제공되는 input 등은 브라우저나 사람들 개인 pc 에 따라
특성을 타는 경우가 종종 있더군요 해서 기본적으로 제공하는 것들은 그냥 css 나 자스 처리 없이 그냥
나뚜는게 속 편하더군요
네 저도 input 에 bg 넣어서 버튼 만들면 브라우져마다 다르게 뜨는 경우가 있어서 못쓰겠더라고요
와우! 완전 감사합니다 ㅋㅋㅋㅋㅋㅋ
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
11-10-25 조회 2,493
11-10-18 조회 4,024
11-10-18 조회 2,401
11-10-15 조회 3,620
11-10-10 조회 2,674
11-10-02 조회 2,592
11-09-28 조회 2,406
11-09-24 조회 2,492
11-09-22 조회 2,391
11-09-05 조회 2,876
11-08-31 조회 2,253
11-08-31 조회 2,562
11-08-31 조회 2,418
11-08-29 조회 2,965
11-08-28 조회 2,461
11-08-25 조회 2,512
11-08-17 조회 2,229
11-08-16 조회 2,464
11-08-11 조회 2,917
11-08-07 조회 2,631
11-08-03 조회 2,341
11-07-22 조회 2,085
11-07-12 조회 3,303
11-06-27 조회 2,087
11-06-01 조회 1,752
11-05-17 조회 2,538
11-05-01 조회 2,609
11-04-28 조회 2,897
11-04-28 조회 2,946
11-04-13 조회 2,605
11-03-27 조회 2,728
11-03-27 조회 2,604
11-03-14 조회 2,019
11-03-02 조회 2,342
11-03-02 조회 2,573
11-02-27 조회 3,000
11-02-23 조회 2,380
11-02-19 조회 2,521
11-02-14 조회 4,136
11-02-03 조회 2,929
11-01-24 조회 3,872
11-01-04 조회 2,403
10-12-08 조회 5,413
10-11-15 조회 2,423
10-11-14 조회 2,597
10-11-14 조회 3,614
10-10-29 조회 3,689
10-10-19 조회 2,701
10-10-07 조회 2,528
10-10-05 조회 4,446
10-09-18 조회 2,744
10-09-18 조회 2,482
10-09-17 조회 4,890
10-09-15 조회 2,828
10-09-15 조회 2,353
10-09-15 조회 2,846
10-09-15 조회 2,675
10-09-11 조회 4,000
10-09-11 조회 2,508
10-09-11 조회 2,545
10-09-07 조회 3,821
10-09-07 조회 3,356
10-08-29 조회 2,816
10-07-01 조회 3,067
10-06-30 조회 2,470
10-06-30 조회 2,652
10-06-30 조회 3,005
10-06-13 조회 2,041
10-04-15 조회 3,212
10-04-04 조회 3,444
10-02-23 조회 3,545
10-02-09 조회 3,143
10-01-25 조회 2,651
10-01-25 조회 2,750
09-12-27 조회 4,396
09-11-23 조회 3,619
09-11-20 조회 4,853
09-08-30 조회 3,051
09-08-30 조회 3,048
09-08-12 조회 3,015
09-07-22 조회 4,077
09-07-22 조회 4,723
09-07-15 조회 5,891
09-07-11 조회 2,968
09-06-17 조회 2,711
09-06-15 조회 2,997
09-05-29 조회 3,276
09-05-11 조회 5,914
09-05-08 조회 2,670
09-04-30 조회 3,787
09-04-17 조회 3,103
09-04-04 조회 3,287
09-03-05 조회 3,671
09-02-09 조회 3,638
09-02-03 조회 6,144
08-12-27 조회 3,208
08-12-20 조회 4,298
08-11-21 조회 5,258
08-11-14 조회 2,825
08-11-03 조회 3,290