Design and CSS styles
Version 3.x > Design and CSS styles > WebPart css problems when in design mode View modes: 
User avatar
Member
Member
Kevin - 1/26/2009 4:49:12 AM
   
WebPart css problems when in design mode
Hi,

I'm have a problem with the styling of webparts and webpart zones in design mode. The problem is that styles applied to containers around webparts are being applied to the webpart "widget". So, as a very basic example, say I have the following...

<h1><cc1:CMSWebPartZone ID="zoneHeader" runat="server" /></h1>

When you view this is Design mode, the webpartzone "widget" has the same styling as the H1 tag. My thoughts on how to solve this are to include styles in each sites CSS forcing the webpartzone styles (.WebPartHeader .WebPartBorder etc) back to default.

Has anyone else found this problem and/or a solution?

Thanks,
Kevin.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/27/2009 3:25:47 AM
   
RE:WebPart css problems when in design mode
Hi Kevin,

We would recommend you not to style like your example but style the particular web parts.

If you mean you need to style the web part zones please provide us more details so that we could advice you the solution.

Best regards,
Helena Grulichova

User avatar
Member
Member
Kevin - 1/27/2009 5:41:41 AM
   
RE:WebPart css problems when in design mode
Hi, thanks for the reply. It's not always possible to just apply styles to webparts. Maybe if I expand on the previous example a little it will demonstrate the problem a little better? Say I want to have a page title (<h1>) which I want to be editable by a CMS editor. I also don't want them to be able to remove the <h1> tags. Say that because of the style of the site I've added the following CSS...

body { test-align:center; }

This means that when I view the site in design mode it looks like this:
http://www.internetgeeks.co.uk/images/kentico.jpg

I realise that there are ways round this, but none of them seem ideal. I was wondering if anyone had found a way to reset these styles when in design mode?

Thanks,
Kevin.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/30/2009 1:40:27 PM
   
RE:WebPart css problems when in design mode
Hi Kevin,

You could use the general web part properties: Content before (<h1>) and Content after (</h1>). Eventually, you could change the layout of web part: http://devnet.kentico.com/docs/devguide/customizing_web_part_layout.htm

Then you could deny the access to Design tab for CMSEditors (permission: Modules -> CMS Content -> Design web site).

Best regards,
Helena Grulichova