2014-07-10 4 views
1

텍스트 상자 CSS에 이미지를 추가하는 것은내 텍스트 상자 여기</p> <p>에 이미지를 추가하기 위해 노력하고있어

<form id="findPromo"> 
    <input type="text" name="find" placeholder="I'm Looking For..."> 
    <input type="button" value="Search"> 
</form> 

CSS를

#findPromo input[type="text"] { 
    background: url(image/find.png) no-repeat 10px 6px #444; 
    background: #444; 
    border: 0 none; 
    font: bold 12px Arial,Helvetica,Sans-serif; 
    color: #d7d7d7; 
    width:150px; 
    padding: 6px 15px 6px 35px; 
    -webkit-border-radius: 20px; 
    -moz-border-radius: 20px; 
    border-radius: 20px; 
    -webkit-transition: all 0.7s ease 0s; 
    -moz-transition: all 0.7s ease 0s; 
    -o-transition: all 0.7s ease 0s; 
    transition: all 0.7s ease 0s; 
} 
#findPromo input[type="text"]:focus { 
    background: url(image/find.png) no-repeat 10px 6px #444; 
    color: #6a6f75; 
    width: 200px; 
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset; 
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset; 
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset; 
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); 
} 

는하지만 이미지가

을 나오지 않는 코드를입니다

누구나 어떻게 할 수 있는지 알고 있습니까?

감사

당신이 줄을 제거하는 경우가 background: #444;와 배경 prorepty을 재정의하기 때문입니다

답변

4

, 이미지가 표시됩니다 : 첫 번째 CSS의 규칙 세트에서

DEMO

1

, 당신을 처음 배경을 이미지로 설정 한 다음 background: #444 규칙으로 덮어 씁니다. 배경색을 덮어 쓰는 것이 아니라 전체 background 문을 덮어 씁니다.

첫 번째 문에 이미 #444이 있으므로 두 번째 문을 안전하게 제거 할 수 있습니다.

관련 문제