跟随按钮右对齐,但我希望x显示在右侧,而不是跟随取消关注按钮的左侧。我正在使用浮动按钮,并且也向右浮动X,但按钮浮动到X的右侧。我如何反转这些,同时保持功能,当我点击X时整行消失?
我希望X出现在按钮的右侧,但是如果我这样做,按下X后该功能将不再隐藏整行:
<?php
$users = show_users_userspage();
$following = following($_SESSION['user_id']);
if (count($users)){
?>
<table cellspacing='0' cellpadding='1' width='320'>
<?php
foreach ($users as $key => $value){
echo "<tr valign='bottom'>\n";
"<td>"."<div class='alert alert-success'>".$key ."</td>\n";
echo "<td><img src='/social_learning/images/thebombthumb.gif'> ".$value;
if (in_array($key,$following)){
echo "<small><a style='margin:10px 20px 0px 5px;float:right;' class='btn btn-danger btn-mini' href='/social_learning/php/action.php? id=$key&do=unfollow'>unfollow</a></small><a class='close' style='margin:10px 0px 0px 5px;' data- dismiss='alert'>×</a></div>";
}else{
echo " <small><a style='margin:10px 20px 0px 5px;float:right;' class='btn btn-warning btn-mini' href='/social_learning/php/action.php? id=$key&do=follow'>follow</a></small><a class='close'style='margin:10px 0px 0px 5px;' data- dismiss='alert'>×</a></div>";
}
echo "</td>\n";
echo "</tr>\n";
}
?>
答案 0 :(得分:2)
浮动:右向后工作。只需反转两个(按钮/ x),首先显示X,然后按下第二个按钮。