gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 13:13:52 24 4
gpt4 key购买 nike

我使用下面的代码,我需要为编辑和删除设置条件,但是问题是我希望细节接近删除,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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com