Try our conversational search powered by Generative AI!

CssClass for elements

Vote:
 

Hi all,

I use this code to add css class to tag 

new {  CustomTag = "ul", CssClass = "menu" }

Thus, in view mode I get desired result (<ul class="menu">), but in edit mode it works different:

<ul class="epi-editContainer" data-epi-property-rendersettings="{"childrenCustomTagName":"li","tag":"span5","customTag":"ul","cssClass":"menu"}" data-epi-use-mvc="True" data-epi-property-name="Members">

Therefore in edit mode it looks as a mess.

Also as I understand "CssClass" works only if "CustomTag" is defined. But what to do if I want to add css class to image element. The following code doesn't work:

@Html.PropertyFor(m => m.CurrentPage.Image, new { CssClass = "alignleft" })

#66650
Mar 06, 2013 10:25
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.