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

razor - Is this a bug in WebMatrix PageData? -

iphone - Requiring the presence of a method in an id -

xslt - Is it possible to select a node that just includes a subset of the child nodes? -