N
N
nxn2012-11-17 10:30:13
css
nxn, 2012-11-17 10:30:13

css separator for individual elements

By the power given to me below, I cannot use an iFrame to display a page within another page. Therefore, I have a div (with id="contentFrame"), into which I load html with ajax. So for this diva has its own css, which should not intersect with the css of the main container page. In this special css file I can of course add a #contentFrame before each element, like this:
#contentFrame body { margin: 0; }
#contentFrame a { color: #aaa; }
and so on.

But this is somehow sloppy, I have a lot of things in this css, and it’s not a hunt to attribute a thousand times to #contentFrame for every garbage. Tell me guys, for Christ's sake, is there any elegant solution like
start #contentFrame
body { margin: 0; }
a { color: #aaa; }
etc.
end #contentFrame

?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vosi, 2012-11-17
@nxn

There is no other acceptable solution than you described.
There are different methods for this solution… one of them is to use some kind of LESS/SASS/YouNameIt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question