텍스트 입력란에 아이콘을 넣으려고합니다.
예 :
텍스트 입력란에 아이콘 넣기
한 용액 배경 화상을 사용하고 사용되는 패딩 왼쪽한다.
하지만 CSS 스프라이트를 사용하고 싶습니다. 다음 코드를 시도 :
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.input {
padding-left:35px;
width: 128px;
background: Red;
}
.sprite:before{
background: url('http://img45.imageshack.us/img45/4259/buildingssheet7dv.png');
content: " ";
position: absolute;
height:32px;
width:32px;
margin: -10px 0 0 -10px;
z-index:100;
}
.sprite:before {
background-position: -32px 0;
}
</style>
</head>
<body>
<input type="text" class="input sprite"></input>
</body>
</html>
내가 뭘 잘못하고 있니?