Even redeclaring all properties in CSS will be much better than using javascript to fix it.
Something like #myModule * { margin:0; padding:0; font-family:Arial; color:#000; height:auto; width:auto; font-size:10px; letter-spacing:1; line-height: 1; text-indent:0; overflow:visible; border:0 none; background: #FFF; float:none; clear:none; } Should be enough, then you would just make sure you declare *every* style you need on on your own CSS, even the defaults. If you wanted complete outside styles 'protection', you could load everything inside an iframe. ? On Feb 12, 11:07 am, Nic Luciano <adaptive...@gmail.com> wrote: > I considered it, but because of the ambiguity I run into I just need > to specify every single Css property... Thought there might be > something clever I could do with jquery but pobably not... Thanks > > Sent from my iPhone > > On Feb 12, 2009, at 12:08 AM, Ricardo Tomasi <ricardob...@gmail.com> > wrote: > > > > > You could a use kind of "CSS reset" for your container. I usually > > don't like '*' declarations but this seems fit here: > > > #myModule * { margin:0; padding:0; font-family:Arial; color:#000; > > height:auto; width:auto } > > > On Feb 11, 11:09 pm, Nic <adaptive...@gmail.com> wrote: > >> The scenario: I am developing a module that will live on any page > >> it's > >> requested to live on (any website). The issue is that if the website > >> it's on has a broad style definition (ie. p { margin: 20px; }), this > >> will affect my elements (in addition to the styles I define). Is > >> there > >> a way I can ensure that only the styles I apply are used, or to clear > >> all styles of my elements before I apply my own? So if someone has > >> such a definition on their page, it won't effect my module. I know I > >> could explicitly redefine the style myself, but there is no way of > >> telling ahead of time what styles will be defined (without defining > >> every single css property for every single element)- so a catch all > >> would be nice. > > >> Thanks, > >> Nichttp://www.twitter.com/nicluciano > > >> Sent from my iPhone