如何让Sitecore字段渲染器对图像使用css类
使用Sitecore(7)和MVC,我想知道如何将图像的css类属性添加到Sitecore中的字段渲染器中 如果没有Sitecore,它看起来是这样的:如何让Sitecore字段渲染器对图像使用css类,css,asp.net-mvc,sitecore,sitecore7,sitecore-mvc,Css,Asp.net Mvc,Sitecore,Sitecore7,Sitecore Mvc,使用Sitecore(7)和MVC,我想知道如何将图像的css类属性添加到Sitecore中的字段渲染器中 如果没有Sitecore,它看起来是这样的: <div class="background-container"> <img src="/images/background-1.jpg" class="background"> </div> 使用Sitecore: <div class="background-container">
<div class="background-container">
<img src="/images/background-1.jpg" class="background">
</div>
使用Sitecore:
<div class="background-container">
@Html.Sitecore().Field(Constants.Fields.HomeBackgroundImage)
</div>
@Html.Sitecore().Field(常量.Fields.HomeBackgroundImage)
似乎没有办法将类背景添加到Sitecore中的映像本身。还有别的办法吗
谢谢。这正是我想要的:
@Html.Sitecore().Field("MyFieldName", myItem, new { Parameters = new SafeDictionary<string> { { "enclosing-tag", "h2" } } })
@Html.Sitecore().Field(“MyFieldName”,myItem,new{Parameters=new SafeDictionary{{“封闭标记”,“h2”}})
看。可能重复的是,@CBroe我看了看,这不是我想要的。