2017-12-24 2 views
1

나는 텍스트 필드 내부 굉장 글꼴에서 클릭 할 수있는 시간 (X)를 넣어려고하지만 난 그것을 할 수도 여기에 모든 클래스에 대한 문서의 부족 ... 내가 가진 것을에 대한 링크x를 텍스트 필드 안에 넣는 방법은 무엇입니까?

<input type="text" class="form-control" id="copy-text"> 
    <span> 
     <i class="fa fa-times xicon" aria-hidden="true"></i> 
     </span> 

    <span class="input-group-btn"> 

     <button id="copy-emoji" data-clear-btn="true" class="form-control btn-large btn-lg btn btn-success" type="button" onclick="copyall()">COPY</button> 

     </span> 
</div> 

https://jsfiddle.net/2Lm6fup1/

감사

+0

가능한 복제 [폰트 텍스트 입력 요소 내부 편집 아이콘 (https://stackoverflow.com/questions/19285640/font-awesome-icon-inside-text-input-element) – jmargolisvt

답변

1

당신은 .input-group에있는 아이콘의 상대적 위치를 지정할 수 있습니다.

.xicon.over { 
    position: relative; 
    top: 11px; 
    left: -24px; 
    width: 0; 
    z-index: 999; 
    cursor: pointer; 
} 

https://jsfiddle.net/2Lm6fup1/5/

+0

왜 클래스를 추가 했습니까? –

관련 문제