css - Apply external stylesheet to a particular section -


on website allow user-generated style sheets used. don't want styles affect the whole website, separate section/div. there way that, without going through whole custom style sheet , adding div selector every css rule? example if user has:

a, span{color:white;} div{padding:10px;} 

right have parse out , replace

#mysection a, #mysection span{color:white;} #mysection div{padding:10px;} 

nope, unfortunately there isn't. there no css equivalent <base> tag or similar limit scope of css rule.

you have prepend every rule element(s) want apply them to, or load user styled content in iframe.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -