我有一个 asp.net 应用程序,其中存在样式问题。在 View 中我有这个片段:
@if (Model[0] > 5)
{
@Html.ActionLink("<<<<", "Projects_Management", new { inc = Model[0] - 5 }, new {@class="previous"})
}
@if (Model[0] < 5 * Model[2])
{
@Html.ActionLink(">>>>", "Projects_Management", new { inc = Model[0] + 5 }, new {@class="nextIcon"})
}
CSS
.previous
{
margin-left:10px;
background: url('../images/previousIcon.png') no-repeat border-box right;
display: block;
width: 150px;
height: 50px;
text-indent: -9999px; /* hides the link text */
}
.nextIcon
{
margin-left:80%;
background: url('../images/nextIcon.png') no-repeat border-box right;
display: inline-block;
width: 150px;
height: 50px;
text-indent: -9999px; /* hides the link text */
}
但我有这个结果:
链接demo
这两个链接不在同一行。那么问题是什么:为什么他们不在同一条线上?我该如何修复我的代码?
最佳答案
.previous
类具有display: block
样式,将其替换为inline-block
就像.next
类
关于.net - 在 asp.net 应用程序 View 中固定元素位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19700944/