HTML/CSS issue with aligning floated buttons -


i need aligning accept/decline buttons. because used float: right; command, cancel button thrown far right side of boarder, , don't know way how align properly.

<?php  echo' <html> <head> <style>  p {      border: 1px solid black;      width: 22%;      text-align: left }  label {     display: inline-block;     float: left;     clear: left;     width: 300px;      text-align: left;     padding: 5px; }  input  {   display: inline-block;   float: right; }     left { float: left; padding: 5px; }  </style> </head> </html>';  $conn = mysqli_connect('localhost', 'root', 'admin', 'users'); mysqli_set_charset($conn, "utf8");  echo ' <form action = "script.php" method = "post">     <div>         <p>              <label>username:    <input type = "text" name = "id">  </label>             <br>             <label>name:          <input type = "text" name = "name"></label>             <br>             <label>surname:     <input type = "text" name = "surname">  </label>             <br>                 <label>address  <input type = "text" name = "address"></label>             <br>             <left><input type = "submit" value = "accept"></left>             <input type = "submit" value = "cancel">             <br>             <br>             <br>             <br>             <br>         </p>     </div>  </form>';      if(isset($_post["id"])  && isset($_post["name"])  && isset($_post["surname"])  && isset($_post["address"]))     {         $id = mysql_real_escape_string ($conn, $_post["id"]);         $ime = mysql_real_escape_string ($conn, $_post["name"]);         $priimek = mysql_real_escape_string ($conn, $_post["surname"]);         $naslov = mysql_real_escape_string ($conn, $_post["address"]);          mysqli_query ($conn, "insert place ( id, name, surname, address)         values (".$id." , ".$name." '.' ".$surname." , ".$address.")");          if(mysqli_affected_rows($conn) ==0)             echo "information not added! ";         else             echo "information added! ";     }  ?> 

use div style="clear:both;" or div class="clearifix"

whenever use float css.


Comments