开发者

Generate a CSS file from HTML markup

I create a lot of html and css pages. Is there a way to markup an html file, than generate a css file from the markup.

Here's what i'm thinking:

Example Markup

<body id="home">
   <section id="main">
       <article>
           <p>Some content</p>
       </article>
   </section>

   <aside>
       <article>
           <p>Some more content</p>
       </article>
   </aside>
</body>

Example of gen开发者_运维问答erated CSS

#home {  }
#home #main {  }
#home #main article {  }
#home #main article p {  }

#home aside {  }
#home aside article {  }
#home aside article p {  }


Yes, there is: parse the HTML and walk the DOM tree to generate your skeleton CSS file.

PS: that IS very impractical CSS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜