도

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

· 2011-02-16 (수) 16:25:08 · 2144 · 5

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

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-08-16 조회 2,407
11-08-16 조회 2,385
11-08-12 조회 2,217
11-08-02 조회 2,801
11-07-27 조회 2,190
11-07-25 조회 2,314
11-06-28 조회 2,476
11-06-06 조회 3,985
11-06-04 조회 2,579
11-04-25 조회 6,163
11-04-22 조회 2,664
11-04-21 조회 2,883
11-04-08 조회 3,284
11-03-31 조회 2,809
11-03-20 조회 3,230
11-03-10 조회 2,855
11-03-04 조회 3,180
11-03-03 조회 2,903
11-02-26 조회 4,326
11-02-14 조회 5,682
11-02-08 조회 3,287
11-01-30 조회 5,383
11-01-14 조회 5,167
11-01-14 조회 3,721
11-01-14 조회 2,881
11-01-14 조회 2,918
11-01-14 조회 3,065
11-01-12 조회 2,834
11-01-07 조회 4,498
10-12-29 조회 2,483
10-12-22 조회 2,469
10-12-05 조회 5,870
10-11-22 조회 5,226
10-11-13 조회 3,598
10-10-27 조회 3,212
10-10-21 조회 2,908
10-09-21 조회 2,913
10-09-17 조회 2,952
10-09-15 조회 3,400
10-09-14 조회 4,014
10-05-18 조회 2,882
10-02-17 조회 4,315
10-02-12 조회 3,087
09-12-14 조회 5,152
09-12-14 조회 6,025
09-09-19 조회 4,382
09-08-16 조회 6,229
09-07-22 조회 5,635
09-04-13 조회 3,046
09-03-15 조회 5,050
09-03-05 조회 3,879
09-02-09 조회 2,826
08-12-30 조회 3,020
08-12-06 조회 3,221
08-11-30 조회 3,563
08-10-18 조회 4,399
08-10-08 조회 3,787
08-09-19 조회 4,345
08-09-05 조회 2,984
08-09-05 조회 5,091
08-09-05 조회 2,972
08-09-05 조회 3,564
08-09-05 조회 3,479
08-09-01 조회 4,502
08-08-07 조회 2,752
08-06-08 조회 3,224
08-06-02 조회 2,814
08-05-26 조회 5,239
08-05-09 조회 4,307
08-04-22 조회 3,895
08-04-17 조회 4,488
08-04-17 조회 5,561
08-04-17 조회 3,702
08-04-17 조회 8,683
08-04-17 조회 4,595
08-04-17 조회 4,498
08-04-09 조회 3,052
08-03-31 조회 3,550
08-03-26 조회 3,252
08-03-25 조회 3,539
08-03-25 조회 3,967
08-03-25 조회 4,009
08-03-25 조회 3,669
08-03-25 조회 3,562
08-03-25 조회 3,562
08-03-25 조회 5,253
08-02-03 조회 5,325
08-01-18 조회 6,625
08-01-17 조회 3,926
08-01-17 조회 3,737
08-01-12 조회 4,031
08-01-08 조회 3,353
07-12-28 조회 4,622
07-12-04 조회 3,496
07-11-30 조회 5,106
07-11-30 조회 5,717
07-11-02 조회 4,018
07-10-24 조회 3,992
07-10-24 조회 3,269
07-10-24 조회 3,377