2016-08-03 49 views
-1

我想把圍棋頁按鈕,輸入中心和導出按鈕權在同一行,它不會低於認沽按鈕輸入中心,並在同一行的另一個按鈕右側


工作

<div> <P style="float: center"> <input type="text" id="page-dir" name="page-dir" maxlength="6" size="4" autocomplete="on" onkeydown="if (event.keyCode == 13) document.getElementById('go-page').click()"/> <button style="float: center" id="go-page" onClick="goPage()">go to page</button> </P> <P style="float: right"> <button id="export" onclick="export()">export</button> </P> </div>

+1

給予一定的代碼請 – Phoenix

回答

0

.container { 
 
    display:block; 
 
    text-align:center; 
 
    width:500px;/*you can use percentage*/ 
 
    position:relative; 
 
    border:1px solid #ff4500; 
 
} 
 
.cont-one { 
 
    display:inline-block; 
 
    max-width:150px; 
 
    border:1px solid #000; 
 
} 
 
#page-dir{ 
 
    width:50px; 
 
} 
 
.cont-two{ 
 
    position:absolute; 
 
    display:inline-block; 
 
    width:50px; 
 
    float:right; 
 
    border:1px solid #000; 
 
    left:450px; 
 
}
<div class="container"> 
 
    <div class="cont-one"> 
 
    <input type="text" id="page-dir" /> 
 
    <button id="go-page" onClick="goPage()">Go to page</button> 
 
    </div> 
 
    <div class="cont-two"> 
 
    <button id="export" onclick="export()">export</button> 
 
    </div> 
 
</div>

相關問題