2016-08-03 34 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>

関連する問題