Microsoft Content Management Server - RE: Applying a CSS style to the ActiveX placeholder

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > April 2004 > RE: Applying a CSS style to the ActiveX placeholder





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RE: Applying a CSS style to the ActiveX placeholder
Kyle

2004-04-26, 9:36 am

Does anyone have an idea why this might be happening? Neither the foreground color nor the background color are applied to the ActiveX control, despite what the CSS class says. I found a workaround so that the background color is applied to the ActiveX co
ntrol but that doesn't do me any good if the foreground color doesn't work. Right now, the only solution I can think of is to parse the CSS file, find the class I want, and apply the color/background-color to the placeholder's body element explicitly.
Trevor Grant

2004-04-26, 11:35 pm

Hi Kyle

Could you tell us how the Css styles were applied?

I've tested the control using an externally linked css
file e.g:

<LINK href="myStyle.css" type="text/css" rel="stylesheet">
which contains:
..myCssClass
{
color: brown;
background-color:yellow;
}

and all the styles were applied, color, background and all.

Hmmm.. are you embedding the styles within a
<style></style> tag? Or maybe there is something else
overriding the styles?

Trevor

>-----Original Message-----
>Does anyone have an idea why this might be happening?

Neither the foreground color nor the background color are
applied to the ActiveX control, despite what the CSS class
says. I found a workaround so that the background color is
applied to the ActiveX control but that doesn't do me any
good if the foreground color doesn't work. Right now, the
only solution I can think of is to parse the CSS file,
find the class I want, and apply the color/background-
color to the placeholder's body element explicitly.
>.
>

Kyle

2004-04-29, 1:37 pm

Thanks for the response, Trevor. I feel foolish admitting this but the reason I was having a problem is because we have nested styles in our CSS. Our stylesheet looks similar to this:

..placeholderStyle {font-weight: bold;}
..bodyStyle .placeholderStyle {color: white; background-color: grey;}

We apply the bodyStyle class to the BODY element and the placeholderStyle class to the placeholder. I was applying the placeholderStyle class to the pPlaceholder.dom.body.className property in Stefan's AutoCssHtmlPhControl but not the bodyStyle.

Which leads to another question. How can I handle this type of nested CSS styles with the ActiveX placeholder? The second style applies only to elements with a placeholderStyle class contained with elements with a bodyStyle. But I'm applying the placehold
erStyle to the ActiveX's body so there is nothing higher in the hierarchy to apply the bodyStyle to.

My current "solution": I apply the bodyStyle to the ActiveX's body, then programmatically wrap the placeholder's content in a div or a span with the placeholderStyle class. I don't like this because it adds the div/span wrapper to the placeholder content
so it has to be stripped again on save (assuming the user hasn't deleted it herself).

Modifying the CSS is another solution but that will be tough to change. Any other ideas?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com