html - 如何在for循环中从右到左文本?

标签 html asp.net css asp.net-mvc-4

我有:

CSS:

.p1
    {
        direction:rtl;
        text-align:right;
        float:right;
    }

查看:

<div class="p1">
    @{
        for (int i = 0; i < 5; i++)
        {
            @Html.ActionLink(i.ToString(), "../home/index/" + i);
        }
    }
</div>

输出为:1 2 3 4 5

但我想要:5 4 3 2 1

最佳答案

找到解决方案:

 <span>
    @Html.ActionLink(i.ToString(), "../home/index/" + i)
 </span>

关于html - 如何在for循环中从右到左文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21348749/

相关文章:

c# - 自动完成在带有母版页的 ASP.Net webform 中不起作用

javascript - 有一个 DIV 'stick' 用于 x 数量的卷轴

html - HTML img 上的 CSS 背景图像

html - 链接控件不起作用

html - 如何将 "Read more"按钮移动到此 WordPress 主题的帖子末尾?

html - 将鼠标悬停在图像上

javascript - 每次刷新时从内部更新面板执行 javascript

html - 签名中的嵌入图像未显示

c# - 在 Web 应用程序的服务器上存储图像的更好方法是什么?

javascript - 使用来自 ASP.NET 的事件数据更新 DIV 内容