我使用bootstrap,我的照片在我的行和列中,但是我找不到在这张照片上放置文字的方法。有没有办法让这成为可能呢?
<div class="container-fluid">
@foreach (Item items in Model.Items)
{
<div class="row">
<div class="col-md-12 text-center">
<img src="~/images/@Html.DisplayFor(modelItem => items.Picture)" />
</div>
</div>
}
答案 0 :(得分:0)
在css中试试这个
.row {
background-image: url("~/images/@Html.DisplayFor(modelItem => items.Picture)");
}
或类似的东西:
<div class="container-fluid">
@foreach (Item items in Model.Items)
{
<div class="row" style=background-image:url("~/images/@Html.DisplayFor (modelItem => items.Picture)">
<div class="col-md-12 text-center">
<img src="~/images/@Html.DisplayFor(modelItem => items.Picture)" />
</div>
</div>
}