Treehouse: Grow your CSS skills. Land your dream job.

Prevent styling of DOM elements inserted by Chrome extension

  • # September 27, 2012 at 5:12 pm


    I created a browser extension that inserts DOM elements directly into a page, and I’d like to prevent them from being styled by any inherited CSS already in the page. At the moment, I append my a css call to the head to bring in my own styles. So far my plan has been to use obscure class/id names and create very specific rules. In some cases I’ve had to use !important. I feel like I’m throwing throwing my morals out the door!

    Any thoughts on how I could efficiently prevent inherited styling, and yet allow the browser to render my code efficiently?

    Any thoughts on how I could use an iframe to do this?


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.