input CSS 질문입니다.
뽀그리
body
style type=text/css
*{margin:0; padding:0;}
.input-text{width:100%; margin:0; padding:0; border:1px solid black;}
/style
div style=width:100px; height:40px; background:red;
input type=input-text class=input-text/
/div
div style=width:200px; height:40px; background:red;
input type=input-text class=input-text/
/div
/bodyinput 에는 기본적으로 border 때문에 background 영역을 하면
input 보다 2px 정도 - 되서 나오는데요...
width 값을 2px 줄이는 방법 말고... 다른 방법을 써서
input 과 같이 background 를 같게 할 수 있나요??
-
한뎃집
가로 100% input인가 보네요
말씀하신것처럼 하면 input의 width가 100%+2px(border값) 으로 계산되서 그런겁니다
input에 border를 주지마시고..
span이라든지div로 한번감싸서 span, div에 border와background를 지정해보세요.. -
빵순
그렇게했는데 width 값은 똑같네요 ㅠㅠ backgrount 영역이 2px 모자랍니다 ㅠㅠ
-
갤원
.input-text{width:100%; margin:0; padding:0; border:1px solid black; vertical-align:middle;}
vertical-align:middle; 을 주세요.
만약 이렇게 했을 경우 ie6 등에서 인풋박스가 아래로1픽셀 씹힌다면. 인풋박스에
margin-bottom:1px 추가해 주시면 됩니다.