2017-06-04 103 views
1

我有一些居中的輸入框。如何在不使CSS移動的情況下跨越元素?

enter image description here

我試圖將文本添加到投注框的右側。這是當我這樣做時會發生什麼: enter image description here

我該如何解決這個問題?我使用span元素將它們放在同一行上。什麼CSS屬性可以解決這個問題?

CODE:

HTML:

<div class="paper"> 
    <h2>Play</h2> 
    <div class="gamebox"> 
     <h1><i class="fa fa-btc" aria-hidden="true"></i>itcoin dice game</h1> 
     <div class="error" id="error">You don't have anymore bitcoins left. Why not deposit some?</div> 
     <h3 id="balance">Balance: 1000BTC</h3> 
     <form> 
      Bet 
      <br> 
      <span> 
       <input id="userbet" onchange="checkBet()" value="1" type="text" name="bet">Error, that bet is not valid. 
      </span> 
      <br> 
      Chance<br> 
      <input id ="userchance" value="50" type="text" name="chance"> 
      <br> 
      <h3>Payout: 0BTC</h3> 
      <button type="button" id="dicebutton" onclick="prepareRoll()" style="vertical-align:middle"><img src="Images/dice.png"> Roll dice!</button> 
     </form> 
     <button type="button" id="autobet">Autobet</button> 
    </div> 
</div> 

CSS:

input[type=text] { 
    width: 20%; 
    padding: 12px 20px; 
    margin : 0 auto; 
    box-sizing: border-box; 
    border: 1px solid #555; 
    text-align: center; 
    display: inline-block; 
} 
+0

向我們展示您當前使用的代碼。 –

+0

更新了帖子。 – linux932

回答

相關問題