Try our conversational search powered by Generative AI!

How to get rid of CSS classes generated in Content Area


We're using EPiServer CMS 8.0 and using MVC. I noticed that EPiServer generates wrapping divs in Content Area including the blocks:





I really don't mind the extra divs but what I want to get rid of is the CSS in block's wrapping divs. I tried the following code:

@Html.PropertyFor(m => m.BannerContentArea, new { ChildrenCssClass = "" })

but it doesn't work. 

May 25, 2015 7:49


Looks like you have your custom ContentAreaRenderer. Default ContentAreaRenderer don't add classes.

AlloyContentAreaRenderer from AlloyMVC generate html as your example.

May 25, 2015 13:37

To get rid of wrapping `div` element you can use following code:

@Html.PropertyFor (m => m.BannerContentArea, new { "hascontainer" = false })
May 25, 2015 23:03

Or actually you can rely on some built-in constants as well:

May 25, 2015 23:05

I ended up creating a custom Content Area renderer

May 26, 2015 12:33
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.