css - 向左移动按钮不起作用

标签 css twitter-bootstrap

我使用下面的代码,我需要为编辑和删除设置条件,但是 问题是我希望细节接近删除,currenlty 向右移动,我尝试向左移动,也尝试使用 "margin-left: 20px" 并且它没有移动, 我应该怎么做?将详细信息移近删除位置?

@if (ViewBag.is)
        {
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ID }) |
            </td>


        }
        <td style="left: 20px">@Html.ActionLink("Details", "Details", new { id = item.ID })</td>

enter image description here

最佳答案

它向右移动是因为您将它从左边移动了 20px 你应该使用 margin-right:20px 将它向左移动

使用

<td style="margin-right: 20px">

  <td style="left: -20px">

 <td style="margin-right: 20px">@Html.ActionLink("Details", "Details", new { id = item.ID })</td>

 <td style="margin-left: -20px">@Html.ActionLink("Details", "Details", new { id = item.ID })</td>

编辑 来自@aashi 的评论

It will be better if you use a div rather than a td then style that div to position:relative n give right/left:0

关于css - 向左移动按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24508174/

相关文章:

javascript - Dropzone.js:自定义文件浏览器 - 添加已上传的文件

javascript - jquery click 不适用于 owl 轮播回调

html - 无法更改输入占位符的颜色

html - agency.css "header-bg.jpg"在一个网站中显示,但在另一个使用相同 Bootstrap 的网站中不显示

twitter-bootstrap - 为什么 Twitter Bootstrap 使用像素作为字体大小?

css - Twitter-Bootstrap 中的响应井?

html - Bootstrap/CSS - 如何在移动设备上排列 2 列

javascript - 访问文本阴影属性值

javascript - 文本对齐 :center and margin:0 auto not working on absolute positioned elements

html - CSS 卡片效果不适用于 Mobile Safari