Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How to isolate CSS styles to one area?
Old 01-04-2011, 04:40 PM How to isolate CSS styles to one area?
Skilled Talker

Posts: 78
Trades: 0
I have ran into the issue of conflicting CSS styling a few times now and would like to know if there is any way other than an iframe to isolate the css styling to one area of the web page without that css affecting other areas of the page.

For example you have a html & css code provided by a third party for a search or sale box to be embedded into your webpage but their css conflicts with your pages css. You could use an iframe but the search box has drop down menus that would be cut off after the iframe area, etc. etc.

Is there any way to build a designated area of the page which keeps the CSS in that area separate from all other areas of the page, i.e. your main pages stylesheet?

Last edited by Boar; 01-04-2011 at 04:43 PM..
Boar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-04-2011, 04:51 PM Re: How to isolate CSS styles to one area?
Defies a Status

Posts: 1,606
Trades: 0
Rename the conflicting items either yours or theirs.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-04-2011, 05:05 PM Re: How to isolate CSS styles to one area?
Skilled Talker

Posts: 78
Trades: 0
Unfortunately, thats not an option, Im talking about large websites with multiple style sheets and thousands of characters of CSS.
Boar is offline
Reply With Quote
View Public Profile
 
Old 01-04-2011, 05:12 PM Re: How to isolate CSS styles to one area?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use an iframe.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-04-2011, 05:47 PM Re: How to isolate CSS styles to one area?
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
I suppose the only thing I can think of is creating an id for that section, and changing the CSS slightly so that it only applies to that DIV.

Using your search box example:

Code:
<div id="searchbox">
Other divs here
</div>
and in the stylesheet:

Code:
#searchbox .theirclass {
stuff
}
or are you linking to their stylesheet, and can't change it? Might have misunderstood...
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 01-05-2011, 01:36 AM Re: How to isolate CSS styles to one area?
Skilled Talker

Posts: 78
Trades: 0
Quote:
Originally Posted by chrishirst View Post
use an iframe.
Well an iframe would be optimal, but like I said if you have a drop down menu such as on a form, then that info gets cut off at the edges of the iframe, and other issues such as this occur in certain instances.

Sounds like the consensus is there is no way to do something similar to an iframe; guess I'll just have to spend hours tinkering with the CSS and renaming in these situations.. Thanks for the replies though
Boar is offline
Reply With Quote
View Public Profile
 
Old 01-05-2011, 01:37 AM Re: How to isolate CSS styles to one area?
Skilled Talker

Posts: 78
Trades: 0
Quote:
Originally Posted by Gilligan View Post
I suppose the only thing I can think of is creating an id for that section, and changing the CSS slightly so that it only applies to that DIV.

Using your search box example:

Code:
<div id="searchbox">
Other divs here
</div>
and in the stylesheet:

Code:
#searchbox .theirclass {
stuff
}
or are you linking to their stylesheet, and can't change it? Might have misunderstood...
No, I am taking posession of the stylesheet, its just for this example I have 4 stylesheets and tons of code that is conflicting, so just wondering if there was a simple solution like an iframe, but sounds like no. I will just have to rework a lot of code
Boar is offline
Reply With Quote
View Public Profile
 
Old 01-10-2011, 06:16 AM Re: How to isolate CSS styles to one area?
Novice Talker

Posts: 10
Name: JD
Trades: 0
i think placing others stylesheet on top of ur stylesheet might help unless 'important' is not used in any of the previous stylesheets
jsd132 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to isolate CSS styles to one area?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.80352 seconds with 12 queries