2016-09-28 23 views
0

试图找出如何图标和文本MVC Html.LabelFor提示

<td>@Html.LabelFor(m => m.MiscellaneousSettings.StudentPhotoUrl, new { @class = "fa fa-question-circle", Title = "SomeTooltips" }) </td> 

之间增加更多的空间,你可以看到它非常接近:

enter image description here

回答

1

在您的CSS添加这:

label.fa:before { 
    margin-right: 5px; 
} 

这将导致:

enter image description here

this JSFiddle

1

添加空间前的学生照片网址

<td>@Html.LabelFor(m => "&nbsp;" + m.MiscellaneousSettings.StudentPhotoUrl, new { @class = "fa fa-question-circle", Title = "SomeTooltips" }) </td> 
+0

完美的作品,但CSS路线将适用于我所有的图标 - 谢谢 – Jesse

相关问题