2016-07-04 3 views
0

파일 입력 컨트롤을 사용자 지정하려고합니다. 내가 한 일은스팬 요소 높이 문제

<div class="ui-select form-input" style="display:inline-block; margin-right:5px; margin-bottom:-8px;width:400px;"> 
    <span class="input-group-btn"> 
     <label class="btn btn-info btn-file" for="multiple_input_group"> 
      <div class="input required"> 
       <input id="multiple_input_group" type="file" multiple name="files" ng-files="getTheFiles($files)"> 
      </div> Browse 
     </label> 
    </span> 
    <span class="file-input-label" ng-model="fileName"></span> 
</div> 

선택에 따라이

<span class="file-input-label" ng-model="fileName"></span> 

표시 파일 이름이었다. 그러나 높이를 확장하고 파일 이름은 내가 그것을 폭을 제공 노력이

enter image description here

처럼 충분히 큰하지만 그것이 작동하지 않은 경우 UI는 비율 밖으로 가져옵니다.

.file-input-label { 
    padding: 0px 10px; 
    display: table-cell; 
    vertical-align: middle; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    height:20px 
} 

어떻게 작동합니까?

+1

는 당신이 일 하시겠습니까? html의 해당 섹션에 대한 모든 CSS를 제공 할 수도 있습니다. – Pete

+0

확장하지 않기를 바랍니다. 그러나 그대로있는 것. 파일 이름 점이나 그와 비슷한 것을 덧붙일 수 있습니다. – StrugglingCoder

+0

오버플로 숨김, 화이트 스페이스 래핑 및 텍스트 오버플로 줄임표 살펴보기 – Pete

답변

0

컨테이너의 높이 (.file-input-label)를 알고 있으므로 테이블 셀로 표시 할 필요가 없습니다. 대신 블록 (또는 인라인 블록)으로 설정하십시오. 세로로 정렬하려면 패딩 (또는 선 높이)을 사용하십시오.