It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

How to isolate CSS styles to one area?

How to isolate CSS styles to one area?

Postby kdjuiopo on Mon Jul 11, 2011 9:26 am

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?
kdjuiopo
50+ Club
 
Posts: 90
Joined: Fri Jul 01, 2011 1:32 am

Re: How to isolate CSS styles to one area?

Postby rajmv on Mon Jul 25, 2011 2:23 am

You could add all your own content under a <div id="myContent"> and then use css rules that read like:
#myContent .myClassIWantToCSS {
color : green;
}

Or you can just not name your classnames and IDs so genericly that it conflicts with other css.
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 0 guests