Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ideas needed ...Multiple stylesheet interference

Status
Not open for further replies.

RADIII

Programmer
Dec 4, 2001
2
US
I'll try to explain, but please post questions if you do not understand.

I am working in an environment that requires me to use multiple stylesheets supplied by other groups within the company. I can not change the stylesheets. Two of the stylesheets are interfering with each other...overriding each others styles.

Is there any way to encapsulate the application of a stylesheet to a specific segment of a page without using frames, iframes, etc.? For example - if you want stylesheet a to apply to the entire page, and stylesheet b to apply to only a specific table or set of tables within the page, can this be done?

Forgive me if this is a very basic question, I do not typically deal with stylesheets.

Thanks for any responses!
 
You'll have to enclose your elements with containers that have unique IDs, and then get the groups to prefix all their rules with those IDs.

Ideal, no. But it's about the only way you'll manage this.

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks BillyRayPreachersSon,

Sorry to ask this, but can you give me some detail around your reply. I am barely familiar with .css (typically a Java guy) and not sure how this all fits together.

Thanks,
Rick
 
You'd put some containers around areas of your code, each with unique IDs:

Code:
<div id="myAreaA">
...
</div>

<div id="myAreaB">
...
</div>

and then prefix all your CSS rules with the IDs of the areas:

Code:
div#myAreaA someRuleHere {
}
div#myAreaA anotherRuleHere {
}

div#myAreaB someRuleHere {
}
div#myAreaB anotherRuleHere {
}

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top