[thelist] (Avoiding) CSS precedence

Barney Carroll barney.carroll at gmail.com
Tue May 11 09:27:39 CDT 2010

It's standard practice for pieces of front-end code for publication  
onto third party sites to be embedded in iframes. Without iframes, you  
cannot tell in what ways the third party's site will manipulate your  
snippet, and they cannot tell how your snippet will manipulate their  
site - the CSS issue is an awkward inconvenience compared to the truly  
nefarious things either company could be doing the other with  
JavaScript - so I would say argue this strongly. What are their  
arguments against?

If this isn't possible, then wrap everything in a div with a highly  
specific ID, reference that in every rule, and use importance to  
specify everything including full font properties, colours and  
metrics. It sounds ugly and fallible. It is. Strongly recommend  
iframes :)

Sent from my iPod

On 11 May 2010, at 11:42, Eike Pierstorff  
<eikepierstorff at googlemail.com> wrote:

> Dear all,
> I have some HTML Code that will be dumped into arbitrary pages, that
> is, the HTML and some javascript and the CSS file are loaded into a
> page via a javascript call for a "widget type" application (see here
> how that looks like: http://tinyurl.com/3al8e2m )
> The problem is of course that my HTML inherits CSS styles from the
> host page, which breaks the layout of the widget, and I had somehow
> underestimated how much trouble that would cause. It seems that I have
> to reset every possible CSS property for every HTML element I use and
> even so it might happen that some rule from the host site takes
> precedence and breaks my code.
> Currently I'm using a lot of !important statements which make for a
> terribly bloated style sheet and is by no means failsafe. Other
> options I have considered so far
> - using iframes - the client specifically does not want this
> - using inline styles - makes for even more bloated code
> - ?....
> Is there any way to insert HTML markup into an arbitrary page and yet
> avoid inheritance/precedence of the CSS of the host page (or another
> way to solve the problem) ?
> Thank your for your time,
> Eike
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !

More information about the thelist mailing list