Resetting styles to default values for a new layer - how

J

John Nagle

I'm writing code under Greasemonkey which inserts little popups into
existing pages. (It's an advertiser-rating system; see "sitetruth.com")
The popups are DIV sections with a Z value that makes them a new layer.

The problem is that the new code is subject to the styles in effect
for the original page. I've tried giving my DIV a class which resets
almost everything, but that's not enough. Pages that tie styles
to all A or P or TD elements still give trouble. There's no obvious
way to override that without affecting the rest of the document.
How do you override such things locally?

Should I insert an IFRAME instead of a DIV layer?

John Nagle
 
T

Thomas 'PointedEars' Lahn

John said:
I'm writing code under Greasemonkey which inserts little popups into
existing pages. (It's an advertiser-rating system; see "sitetruth.com")
The popups are DIV sections with a Z value that makes them a new layer.

The problem is that the new code is subject to the styles in effect
for the original page. I've tried giving my DIV a class which resets
almost everything, but that's not enough. Pages that tie styles
to all A or P or TD elements still give trouble. There's no obvious
way to override that without affecting the rest of the document.

Apparently just not obvious to *you*. Use an ID as selector context.
How do you override such things locally?

Should I insert an IFRAME instead of a DIV layer?

That or an `object' element is the better approach here.


PointedEars
 
J

John Nagle

Thomas said:
Apparently just not obvious to *you*. Use an ID as selector context.

That only works once per document. However, using a class as a selector
context, creating a huge CSS class to reset everything, and using that as
the first class on every element in the DIV may work. Is there anything
less clunky available?
That or an `object' element is the better approach here.

Object elements are for non-HTML content.


John Nagle
 
T

Thomas 'PointedEars' Lahn

John said:
That only works once per document. However, using a class as a selector
context, creating a huge CSS class to reset everything, and using that as
the first class on every element in the DIV may work. Is there anything
less clunky available?

An `iframe' or `object' element.
Object elements are for non-HTML content.

You are mistaken.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top