2015-04-04 72 views
0

按鈕指下跌應該是在中心頂部和旁邊的桌子按鈕在中心向下。我做了按鈕,但問題是,在表.................. [在這裏輸入的形象描述] [1] [1]:http://i.stack.imgur.com/3bxei.jpg按鈕應在中心和桌面旁邊的按鈕,在中心

<html> 
    <body> 
    <head> 
    <style> 

    #buttons{ 
     float:right; 
     position:relative; 
     left:-50%; 
     text-align:left; 

    } 
    #buttons ul{ 
     list-style:none; 
     position:relative; 
     left:50%; 
     width: 100%; 
    } 

    #buttons li{float:left;position:relative; font-size: 23px;}/* ie needs position:relative here*/ 

    #buttons a{ 
     text-decoration:none; 
     margin:10px; 
     background:red; 
     float:left; 
     border:2px outset Red; 
     color:#fff; 
     padding:2px 5px; 
     text-align:center; 
     white-space:nowrap; 
    } 
    #buttons a:hover{ border:2px inset blue;color:red;background:#f2f2f2;} 




    </style> 
    </head> 
    <body> 
    <div id="buttons"> 
     <ul> 
      <li><a href="#"> Home</a></li> 
      <li><a href="#">Add Product </a></li> 
      <li><a href="#">Add Product Image</a></li> 
     </ul> 
    </div> 

    <form> 

    <table> 
     <tr> 
     <td>Jill</td> 
     <td>Smith</td>  
     <td>50</td> 
     </tr> 
     <tr> 
     <td>Eve</td> 
     <td>Jackson</td>   
     <td>94</td> 
     </tr> 
     <tr> 
     <td>John</td> 
     <td>Doe</td>   
     <td>80</td> 
     </tr> 
    </table> 
    </form> 

    </body> 
    </html> 

回答

0

你可以在這裏用這個勾選Js fiddle 在表格外加一個div

.table-con { 
    margin: 0 auto; 
    clear: both; 
    width: 23%; 
}