[css-d] Inheritance Blocking with CSS

2005-05-18 Thread David Boccabella

This is my first CSS post so apologies on any 'errors' re protocol.

I have an unusual situation that I am trying to find a work around on.

We use the FCKEditor to allow our users to generate HTML snippets that
can be saved in a database, and then later these snippets are stitched
together on and HTML page for display.

FCKEditor allows you to use an 'internal' style sheet for items that are
within the editor. We have set up a base style sheet to give our users a
limited range.

Now - our base template HTML pages use a style sheet (very complex one),
and I am placing the gathered snippets within a DIV, that way it makes
it easy to position the DIV on the page and set its width etc.

My problem is this.

The Editors Style sheet is different from our main templates one and
anything that is displayed with the DIV is subject to interaction from
the page in general

Is there a way to set a style sheet in the DIV and have the DIV process
anything that is within it using this style sheet REGARDLESS of what the
Main page style sheet is set to.

So as style sheets go - the DIV is totally separate from the page style.

I know I could possibly do this as an IFrame but there are reasons that
I would prefer not to do this. Although an IFrame would be totally
independent of the parent page in regards to styles.

Any suggestions are welcome. 


Many Thanks

Dave Boccabella





__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Inheritance Blocking with CSS

2005-05-18 Thread Zoe M. Gillenwater
David Boccabella wrote:
This is my first CSS post so apologies on any 'errors' re protocol.
 

Didn't see any, but our list policies and wiki are always there to guide 
you should you have questions about using the list.  Or you can always 
email [EMAIL PROTECTED] if you want to make sure 
something is kosher.

http://www.css-discuss.org/policies.html
http://css-discuss.incutio.com/
http://css-discuss.incutio.com/?page=PostingGuidelines
Now - our base template HTML pages use a style sheet (very complex one),
and I am placing the gathered snippets within a DIV, that way it makes
it easy to position the DIV on the page and set its width etc.
My problem is this.
The Editors Style sheet is different from our main templates one and
anything that is displayed with the DIV is subject to interaction from
the page in general
Is there a way to set a style sheet in the DIV and have the DIV process
anything that is within it using this style sheet REGARDLESS of what the
Main page style sheet is set to.
So as style sheets go - the DIV is totally separate from the page style.
 

The only way you can do this is if you create descendant selectors for 
the div that override all the main styles.  Something like this:

h3 {
   color: #666;
}
#specialdiv h3 {
   color: #333;
}
Zoe
--
Zoe M. Gillenwater
Design Specialist
UNC Highway Safety Research Center
http://www.hsrc.unc.edu
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Inheritance Blocking with CSS

2005-05-18 Thread Adam Kuehn
Zoe M. Gillenwater wrote:
The Editors Style sheet is different from our main templates one and
anything that is displayed with the DIV is subject to interaction from
the page in general
Is there a way to set a style sheet in the DIV and have the DIV process
anything that is within it using this style sheet REGARDLESS of what the
Main page style sheet is set to.
So as style sheets go - the DIV is totally separate from the page style.
The only way you can do this is if you create descendant selectors 
for the div that override all the main styles.  Something like this:

h3 {
   color: #666;
}
#specialdiv h3 {
   color: #333;
}
But note that this does require you to know about all the styles you 
want to override.  There is no way to start from scratch with an 
included DIV.  The stylesheets will all apply to the entire page, 
unless you use some sort of framing.  I'm not too familiar with 
frames, personally, but there are plenty of resources out there that 
could tell you more.

If you do know all the styles ahead of time, you can keep the 
special stylesheet as a separate file you import after the main 
sheet.  That way if you apply changes to either side, you can locate 
what you need to change on the other side much more easily.

Good luck,
--
-Adam Kuehn
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


RE: [css-d] Inheritance Blocking with CSS

2005-05-18 Thread Leszek
 Is there a way to set a style sheet in the DIV and have the DIV process
 anything that is within it using this style sheet REGARDLESS of what the
 Main page style sheet is set to.
 
 So as style sheets go - the DIV is totally separate from the page style.
 

The problem here is that if such a method existed (which, as far as I know,
does not), it would firstly destroy the concept of the cascade from which
CSS is named, and also you wouldn't inherit the browser's default styles,
such as divs being display:block.

The only way I can think of is to anticipate every possible property that
could be changed in your main stylesheet, and set it manually for the div
like Zoe said - but this adds a lot of code overhead to your page, and isn't
100% foolproof.

- Leszek
[EMAIL PROTECTED]

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/