Search code examples
kentico

Kentico v9 Collapsible Panel header class issue


I've noticed when I add a Header CSS class in the web part properties, this value is added to the span and it's parent div for the header. Is this intentional? and what's the easiest way to 'fix' this. Ideally i think the class should only be applied to the wrapper tag on the header copy.


Solution

  • Inspecting the HTML as you mentioned both the Div and the Span have your Header Class and you can tell by the generated IDs that Kentico have used asp:Panel and asp:Label controls.

    Also it's worth noting that if you omit the Collapsed and Expanded text there is no Span.

    I suspect that Kentico have made a concious decision to set the CssClass property on both Controls so that your class applies directly to the text in the Span. However this could have a negative side affect of applying your class to both Elements with CSS properties such as Padding and Margins.

    The 'fix' for now would be to handle this in your CSS. Eg.

    Div.yourClass { padding: 5px; background-color: #eee;}
    
    Span.yourClass { color: #333;}