2012-09-09 3 views
2

나는 아래 asp.net 버튼, 테이블과 버튼이 있습니다입력 태그와 테이블 높이

<table style="width: 600px;"> 
    <tr> 
     <td> 
      <div style="float: right;"> 
       <asp:Button ID="_btn01" runat="server" Text="GO" /> 
       <table class="IHCommandButtonContainer" cellpadding="0" cellspacing="0"> 
        <tr> 
         <td class="IHCommandButtonL"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="/Test/Images/btn_Search.gif" /></td> 
         <td class="IHCommandButtonM"><span>Search</span></td> 
         <td class="IHCommandButtonR"><img src="/Test/Images/btn_R.gif" /></td> 
        </tr> 
       </table> 
       <asp:Button ID="Button1" runat="server" Text="GO" /> 
      </div> 
     </td> 
    </tr> 
</table> 

문제는 내가 같은 줄에 넣어 수 없다는입니다. 그들은 아래와 같이 :

enter image description here

내 CSS는 다음과 같습니다 :

<style type="text/css"> 
    .IHCommandButtonContainer { height: 21px; border: 0px; display: inline-block; cursor: pointer; margin: 0px; padding: 0px; border-spacing: 0px; border-collapse: collapse; } 
    .IHCommandButtonL   { width: 22px; height: 21px; } 
    .IHCommandButtonL input { width: 22px; height: 21px; } 
    .IHCommandButtonM   { background-image: url(/Test/Images/btn_M.gif); height: 21px; font-size: 9pt; font-family: Sans-serif, Arial, Dotum; } 
    .IHCommandButtonM span { margin: 0px 2px 0px 0px; } 
    .IHCommandButtonM_   { background-image: url(/Test/Images/btn_M_.gif); height: 21px; font-size: 9pt; font-family: Sans-serif, Arial, Dotum; } 
    .IHCommandButtonM_ span { margin: 0px 2px 0px 0px; } 
    .IHCommandButtonR   { width: 3px; height: 21px; } 
    .IHCommandButtonR img  { width: 3px; height: 21px; cursor: pointer; } 
</style> 

가 어떻게 같은 줄에 넣어 수 있습니까? 두 개의 GO 버튼이 같은 줄에 있지만, 중간에있는 테이블이 위쪽에 있습니다.

답변

1

CSS의 사용자 "vertical-align"속성. 값을 "중간"으로 설정하십시오.

건배

나는 '개발자 도구'... 트릭은 당신이 무엇을하고 있는지 이해하는 것입니다을 사용에있어 비록
+0

어떤 CSS 클래스는 세로 정렬을 의미합니까? –

+0

개발자 도구를 사용하여 "세로 맞춤"CSS 속성을 설정할 때 어떤 일이 발생하는지 확인하십시오. 그건 그렇고, 귀하의 상황에서 나는 테이블 요소 인 컨테이너에 그것을 설정해야한다고 생각합니다. "vertical-align"에는 "middle", "top", "bottom"또는 "baseline"과 같은 많은 값이 있으므로 필요한 관련 값을 선택하십시오. 건배 – Rikki

+0

많이 thoh Mohammad! –

-1

수직 정렬이 정답입니다 ...

이 것 도와주세요 : http://phrogz.net/css/vertical-align/index.html

버튼을 "display : inline-block"에두면이 문제를 쉽게 해결하는 데 도움이됩니다.

+0

우선 "개발자 도구"또는 다른 것을 사용하는 것에 반대한다는 사실은 질문과 관련이 없습니다. 그러나 그것은 당신의 의견이며 나는 그것을 존중합니다. 언급 한 "표시"속성에 대해서도이 속성을 설정하면보기가 완벽하게 보일 수 있지만 (이 상황에서) 그런 일은하지 않았습니다. "표시"속성의 의무는 무언가이며 "수직 정렬"의 의무는 다른 것입니다. 건배 – Rikki