下面是写的一个html,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Demo: Payment Accounts .wrapper{ font:12px Arial; display: table-row; } .cell50{ width:50px; } .cell100{ width:100px; } .cell200{ width:250px; } .cell50, .cell100, .cell200{ display:table-cell; } .cell300{ display:table-cell; text-align:right; width:300px; }
View by:
Users
Companys
Install New User
我希望Install New User是靠右边的。其他部分都是自适应屏幕大小的,而且都在同一行,所以用了display:table-row; 和 display:table-cell
但这样,问题就来了,最右边的div一定要指定很大的宽度,才能靠右,如果设置了float:right也不行。