javascript - style "scoped" <style scoped> attribute not supported in chrome 36+. Any alternative or substitute for that? -
i using scoped attribute in style tag. not supported chrome browser. alternative or substitute achieving functionality work chrome browser.
the way can achieve you're after use unique classname (or id) each 'section' , use inheritance sort-of namespace css. if want target 1 specific section of page, give it's parents classname (eg: class="testone") , make sure styles want apply section appended classname:
.testone .title{...} .testone h1{...} .testone a{...
etc.
failing that, there jquery-based scope polyfill should give more browser-independent way of working scoped css. isn't i've worked don't have experience offer, looks promising few moments i've spent it!
do remember javascript-based solution one, loads page without javascript enabled isn't going little niceties it's important ensure page still behaves in acceptable manner when js disabled.
source : scoped style sheets without html5
Comments
Post a Comment