Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

No-CSS Inheritance Area

Is it possible to avoid CSS style definitions being applied in region X

9:13 am on Jan 4, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 3, 2007
votes: 0

Is it possible to have a certain region on your page, ex:

<div id="noCSS"
<h1>Heading 1</h1>
<h1>Heading 1</h1>

have no absolute influence over CSS style definitions I define on my CSS style sheet file? What I mean is that... let's use this example for simplicity's sake, if in my master_css_file.css I say that all "h1" tags need to be red, I'd like to know what could I do to make specifically all h1 tags inside that No-CSS zone to not change to red. Please note this is just one simple example, I want a general solution that would work for all tags.

I'd like to know if such feature is possible because I need to have a "No-CSS zone of my site" so that no matter what style definitions I enter on my master CSS file, nothing within that DIV will change. It will have normal default browser definitions just as if no CSS had being used in the first place.

I wish to do this so I can have more control over my CSS. You see, sometimes I have to use include('path/to/file.html'); in PHP and when including an HTML document (even if just what's inside the <body> tag), most of the content will not have preserved its original style definitions. So I am asking this question here to see if it would be possible for me to have more control over my CSS and avoid having these "included HTML files" so messed up by my own CSS master file.

11:19 am on Jan 4, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Feb 12, 2006
votes: 109

you could probably only do that with an iframe. because the iframe would have its own stylesheet

the only way you do it otherwise would be to fake it -- by giving everything a style that looked like it was returning back to its default. something like this would work

#noCSS, #noCSS * { color:#000; background:#fff; border:none; etc etc... }