Advertisement

08.28.2008 at 11:12AM PDT, ID: 23686602 | Points: 250
[x]
Attachment Details

A way to Jail, contain or override cascaded CSS body settings

Asked by zoobuh in Cascading Style Sheets (CSS), Hypertext Markup Language (HTML), Asynchronous Javascript and XML (AJAX)

Tags:

I completely understand how CSS sheets are supposed to work, and it seems I have an issue I am unable to figure out.

I don't want to use frames or iframes for this, but rather a simple div container.   I am trying to isolate user-based HTML submission data from the rest of the page.   A user is able to input / copy-paste data into a field.  This may contain styles and style tags.    I obviously have stripped out any undesired scripting, external rels and what not.  But I do need to allow the usage of styles inside this div as I display the user's content.  

Problem:  A body style declaration is overriding the master CSS sheet (as expected due to the CSS idea), consequently changing margins, a links, visited links, font sizes, etc.   It then alters the template and renders it unusable in some instances.

True I can strip out the <style>, however it would remove all other id and class declarations as well.

So my question; is there some way to reverse the order in which CSS has priority, or is there a way to limit/isolate css content to a <div>?  Is there some other solution someone can provide or idea that would help me out?   I can successfully get this working with an iframe, or a new window, however I would prefer to get the content in one page without popup, or using a frame.

Hope this is clear.Start Free Trial
 
Loading Advertisement...
 
[+][-]08.28.2008 at 04:46PM PDT, ID: 22341001

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.29.2008 at 06:30AM PDT, ID: 22345166

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628