Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any programs to generate css classes from your html? [closed]

Tags:

html

css

Just curious does anyone know a program or script to generate a style sheet(with blank values obviously) from the structure of your html document? Basically just pull out the ID's and Classes you set in your html and make placeholder css so you don't have to plan it ahead of time or write it again ,remember D.R.Y. anyone?:) Feel free to yell at me if you don't think this could help anyone else here :D . I'm sure I could whip something up like that but if it's already out there I might as well stick to my rule of DRABEE(Don't repeat any body else either) . Thanks.

like image 564
UserZer0 Avatar asked Feb 07 '11 10:02

UserZer0


People also ask

How do I eXtract the CSS code from a website?

Install "eXtract Snippet"=> Inspect an element using chrome's developer tools 'inspect element'. Within the developer tools you should also see a panel named "eXtract HTML CSS". Click on to the "eXtract HTML CSS" panel and further click onto the "Get HTML/CSS of inspected element" button withing the panel.

How do I create my own CSS class?

Creating a CSS Class Using a Class SelectorAfter adding the code snippet to your styles. css file, save the file. In this code snippet you have added text using the HTML <p> tag. But you have also specified the red-text class by adding the highlighted class attribute class="red-text" inside the opening HTML tag.

Where can I find CSS classes?

If you're using the Chrome inspector (right click page, inspect element), highlight the line and look to the right. It should show the CSS class and any rules that are used, and a link to the CSS file.


4 Answers

Did you check http://primercss.com/ ? Seems to be doing exactly what you are asking for.

like image 50
pierot Avatar answered Oct 11 '22 23:10

pierot


CSS Frame Generator http://lab.xms.pl/css-generator/ works better than Primer.

like image 28
Marek Ka. Avatar answered Oct 12 '22 00:10

Marek Ka.


Little late to the party but these days, there is also BearCSS:

http://www.bearcss.com/

Disclaimer

This answer is primarily meant to add extra value to this thread and create an overview of CSS generators.

In my opinion, after trying all the mentioned tools in this thread, http://lab.xms.pl/css-generator/ is the best one.

like image 43
Robin van Baalen Avatar answered Oct 12 '22 01:10

Robin van Baalen


I found the best tools out there, after rigorous comparisons of the different available ones:

If you want to generate CSS automatically from the markup online for free, then you need BeeCSS - CSS Generator:

http://beecss.theextremewebdesigns.com/

If you already have (messy) CSS & you would like to clean/minify it online for free, then you need BeeCSS - Cleaner Minifier

http://beecss.theextremewebdesigns.com/css_clean_css_minify/

like image 40
Devner Avatar answered Oct 12 '22 01:10

Devner