How to convert your photoshop document to a CSS in less than 30 seconds, a precise tutorial with illustrations

As a webdesigner you’re working a lot with photoshop and now you would like to convert your psd (or jpg, png, whatever photoshop can read) files to a valid CSS and (X)HTML document.

Do you know that you can do it using photoshop and image ready and that it will take about 30 seconds ? If you want to know how do it everything is explained step by step with proper screen captures just in case ;)

(There’s plenty of books about CSS but few are really good, i would recommend you this one :

The Zen of CSS Design : Visual Enlightenment for the Web (Voices That Matter)

Yep you’re not dreaming this is possible, read on ! :)

1-open your file with photoshop
ouvrir le

2-Edit the document with Image ready
editer dans image ready

3-Slice your document using the “Slice” tool, this will allow you to define all the different parts of your web page (for example, the header, the menu etc.)
outil de slice

4-Now your document should contain blue numeroted squares and lines
résultat de l'image slicées

5-Now you need to specify in image ready the ouput parameters.
output settings

6-Now you choose the CSS export (inside the File->Outputsettings menu)

choisir le css

7-Now you have defined your output options you just have to click on OK. (this will validate your settings but won’t create the file yet).
8-This is the last step, you need to save the result, using “Save optimized” (inside the File menu).

sauver le résultat

And now the work is finished,imageready has just created an “images” folder containing all the sliced images and an html file which is containing in the source code the css code.

If you wanna see/copy/edit the css source code you just need to open the file in your favorite web browser and display the source code.

afficher le code source

-Extract of the css code generated by photoshop/imageready:

code source

Everything is ok now you have your css and XHTML file. Of course you might need to edit it by hand to modify and or tweak some part of it.

I hope that thanks to this tutorial you’ll spend less time doing css and that you’ll have more time to focus on the the creative aspects of your work.

As you can read further down inside the comments section this method has some limitations. In order to become an expert in CSS coding i would recommend you these great books:

HTML Utopia: Designing Without Tables Using CSS (Build Your Own) The CSS Anthology: 101 Essential Tips, Tricks & HacksCSS Mastery: Advanced Web Standards Solutions (Solutions)

kerastase

fer a lisser

remorque occasion


42 Responses to “How to convert your photoshop document to a CSS in less than 30 seconds, a precise tutorial with illustrations”


  1. 1 nogg3r5 Feb 8th, 2006 at 10:50 pm

    Nice. Ill have to try this when i get chance!
    I was thinking about making my own blog template, this may be the motivation i need to give it a try

  2. 2 Peter Feb 9th, 2006 at 2:43 am

    Worst ever. The code is bad, really bad.

  3. 3 Matthias Bonjour Feb 9th, 2006 at 3:49 am

    This is awesome. I am so glad I found this. I am getting into CSS in a big way, finally getting my head around it and this is going to help a great deal… thanks or merci.

  4. 4 Ronald Poi Feb 9th, 2006 at 4:43 am

    It\’s such an interesting way to make things fast but every single div is always absolute, and that\’s not a good sign…

  5. 5 Scott Feb 9th, 2006 at 4:49 am

    Wow! 30 seconds - that\’s terrific! Normally it would take me up to a day or more to really do a proper job of slicing and cropping a .PSD and converting it by hand to HTML/CSS code (I\’m sure that the ImageReady code is equal to any HTML/CSS I could write myself - cross-browser compliant, valid, etc.). You\’re really saving me a great deal of time with your insightful blog post Jean-Jacque! I wonder if I can still charge my clients for 8 hours?

    By the way… Could I see one of these wonderful 30 second templates that you\’re descibing in action, on the web?

    Oh, and if it\’s so easy and only takes 30 seconds to create a web page, why are you still using the default WordPress template? You (and ImageReady) ought to be able to crank out at least one new template each day! I expect a new design up by next week JJ.

  6. 6 Jouko Salonen Feb 9th, 2006 at 4:57 am

    Thank you very much for this article.

  7. 7 Avi Feb 9th, 2006 at 4:58 am

    That’s useless. Why would you trust ImageReady to construct proper xhtml and css? Css is not about asbolute positioning, it’s about a box model. Notice no padding or margin settings in your css? I mean yeah, it’s a start to edit from, but my first edit to ImageReady css would be BACKSPACE.

  8. 8 Avi Feb 9th, 2006 at 5:00 am

    And also, I don’t think I’d consider xhtml and css something a web designer should spend less time doing. There is much creativity in xhtml and css, and maybe you not knowing that has something to do with your template site.

  9. 9 jon mccallon Feb 9th, 2006 at 5:08 am

    I am a designer, but the web and I only get along when I say how something should look and they put my designs together. I have had some success, but still getting there…the whole css thing is so great. for me right now it juts means controlling the text look. how does getting this from images help

  10. 10 shizzle Feb 9th, 2006 at 5:27 am

    fo sheez

  11. 11 Carl Warnick Feb 9th, 2006 at 6:42 am

    You don\’t need step one you can just open the image in ImageReady

    Make sure in Step 8 your Format is set to HTML and Image, not just Image as many folks do.

    Nice How-To, Thanks.

    carl
    .

  12. 12 JMF Feb 9th, 2006 at 8:49 am

    This may produce valid XHTML/CSS but it won\’t be semantic. Moreover, you can not create fluid designs this way.

    Remember, a valid code is just the beginning not the end of a quality site.

  13. 13 marie Feb 9th, 2006 at 12:44 pm

    wow! O.O!

  14. 14 Tony Feb 9th, 2006 at 4:52 pm

    This is the \’quick and dirty\’ way of converting a Photoshop layout to a webpage, emphasis on \’dirty\’. If your designers aren\’t familliar with what HTML and CSS can do, you can end up with some pretty nasty results. I generally like to come up with a concept in Photoshop, while keeping in mind these limitations, and then hand-code the HTML and CSS to match.

    Simply slicing your layout into tons of images ends up being inefficient and impractical, IMNSHO.

  15. 15 Avi Feb 9th, 2006 at 5:19 pm

    Even though you are going to moderate this you should know how stupid this method is…

  16. 16 pickupjojo Feb 9th, 2006 at 5:20 pm

    Et aucun problème de validité ?
    Merci pour le tuto en tous cas.

  17. 17 lacop Feb 9th, 2006 at 5:51 pm

    Nice one, thx :)

  18. 18 seanybabes Feb 9th, 2006 at 7:40 pm

    thanks dude, im an amatuer web designer at best, and this will save a load of time.
    Cheers!

  19. 19 Mike Feb 9th, 2006 at 7:58 pm

    Very nice tut, thanks.

  20. 20 Bryan Feb 9th, 2006 at 9:34 pm

    Well, this is if you want a crappy CSS document. I mean, no offense to your article, you are just showing how to use Adobes product to accomplish this task, but the quality of the css document won\’t be very good.

    Anytime you have a site that has every single element absolutely positioned, it\’s going to be poorly structured.

    Good job on the tutorial, unfortuntely all it does it promotes bad behavior, in my opinion.

    It goes along with that issue of promoting bad code. It gets copied and repeated over and over so there is twice as much bad code that people use.

  21. 21 Warren Feb 9th, 2006 at 11:26 pm

    Yes way too easy (except perhaps the french browser option to view source) but I myself learnt this only recently when getting into Mambo/Joomla template creation. I think I still need to learn more about the naming conventions that should be applied to the slices/layers, and also to educate my graphic designer in same before sending the psd\’s to me.
    I think I am also still finding some of the tricks in terms of the \’auto-slice\’ generation or doing all slices/covering the entire page before exporting, alignment of slices and simplifying it so that it makes nice tables to post-edit too. Also to comment on the fact that this method is great for setting up mouse-over events and pre-defining links/alt-text and the like too.
    Nice doc, thanx. Warren.

  22. 22 jean-jacques Feb 10th, 2006 at 7:53 am

    Hi Peter, Of course the code automatically generated is not very good but you still can use it and improve it by hand. This was only intended for beginners to start playing around with css.

  23. 23 jean-jacques Feb 10th, 2006 at 7:58 am

    Hi Scott,
    The technique explained in this tutorial won’t replace the hours that you need to spend in order to tweak and arrange your css for your clients but i’m sure that you can use this technique to improve your productivity.
    About the templates, as i’m not a webdesigner i won’t be able to change it every week, but you can be sure that i’ll try to personalize it a little bit more the next days.

    Best regards,

  24. 24 kiddo Feb 10th, 2006 at 1:47 pm

    Wow, some of these people are dicks. Why would you be so rude to someone who’s trying to be helpful?

    Anyway, thanks for the tip. I knew you could slice and export as html tables, but I didn’t know all this was possible. I wouldn’t use this for a full page layout, but it will be very useful for chucks of pages that need very specific image arrangement.

    Many thanks!

  25. 25 Jonathan Feb 14th, 2006 at 9:11 pm

    Full agreement regarding the *icks who are taking issue with the article. This guys just trying to give you someplace to start. If you want the results of an imageready export to be CSS box model complaint, go ask Adobe to make it so. It\’s that simple.

  26. 26 Jonathan Feb 14th, 2006 at 9:12 pm

    oops. …compl-i-ant.

  27. 27 steve Feb 16th, 2006 at 5:56 pm

    yeah the css file is a little dirty, but all in all it’s a good start for me it works perfectly i like to think it’s giving me the opportunity to make visually rich sites and code the css so all i have to do is go in and make a few changes :D thanks for the good tut

    stv

  28. 28 Andre Feb 18th, 2006 at 2:23 pm

    De todas formas - incluye tablas :-(
    It includes div tables :-(

  29. 29 Alex McKee Feb 20th, 2006 at 2:19 pm

    OK so this method is actually how I’ve been working with most of my sites anyway. Sure the CSS is dead dirty but you can clean it up and convert it to a proper layout.

    Most of the CSS positioning is rubbish. You need to entirely re-construct the positioning but that’s ok. It’s also advisable to put the images in the BG. As someone else said, ensure you’ve got HTML + Images ticked not just images.

    Otherwise yes this is a perfectly ok method.

  30. 30 Jesus Feb 24th, 2006 at 2:48 pm

    Yeah maybe the css file is not perfect..but this is a bit better than firework’s output =| thanks for the tip…

  1. 1 Ronald Yau » Blog Archive » How to convert your photoshop document to a CSS in less than 30 seconds Pingback on Feb 8th, 2006 at 6:06 pm
  2. 2 Richard John’s Blog » Blog Archive » Photoshop to CSS/XHTML in 30 Seconds Pingback on Feb 8th, 2006 at 10:50 pm
  3. 3 meneame.net Trackback on Feb 9th, 2006 at 8:31 am
  4. 4 Global Advanced Media WeBlog Trackback on Feb 9th, 2006 at 9:44 am
  5. 5 the jackol’s den»Blog Archive » Web Design Guides - Mikhail Esteves Pingback on Feb 9th, 2006 at 11:18 am
  6. 6 Linkorama » Convierte un documento de Photoshop a CSS en menos de 30 segundos Pingback on Feb 10th, 2006 at 12:24 am
  7. 7 NerdJournal » Blog Archive » links for 2006-02-10 Pingback on Feb 10th, 2006 at 1:35 am
  8. 8 Nogz Blogz :: Convert Photoshop Douments to HTML and CSS Easily ::February ::2006 Pingback on Feb 10th, 2006 at 9:27 am
  9. 9 Gancé » Blog Archive » Memo Pingback on Feb 12th, 2006 at 2:06 am
  10. 10 LOLO punto ES » Blog Archive » Manuales sobre CSS Pingback on Feb 13th, 2006 at 1:56 pm
  11. 11 Criterion :: Diseño gráfico y editorial, recursos y enlaces de utilidad :: Pingback on Feb 13th, 2006 at 2:42 pm
  12. 12 Interactive Chris » Css photoshop firefox Pingback on Mar 17th, 2006 at 9:19 am
Comments are currently closed.


cialis overnight buy lasix online order levitra buy no rx cialis buy cheapest viagra online accutane discount find cialis on internet purchase synthroid find cialis lasix online cheap buy cheap lasix approved viagra pharmacy viagra for order buy synthroid online zithromax generic buy cheap viagra cialis sale cheap levitra clomid generic synthroid for sale accutane online cheap cheap viagra in uk cheap acomplia tablets cheap viagra without prescription where to buy soma order zithromax buy generic viagra online cheap acomplia levitra online purchase viagra without prescription order propecia cheap price cialis where to buy clomid accutane without prescription cialis medication propecia cost viagra best price cialis online acomplia cheap soma online order soma buy lasix cheap discount cialis propecia without prescription cheapest clomid buy cheap zithromax price of soma acomplia generic clomid pills viagra pills order viagra on internet zithromax prices discount viagra without prescription cialis malaysia buy cialis on internet zithromax without prescription discount zithromax cialis tablet lowest price for cialis viagra cheap cialis cheap drug cheap cialis overnight delivery buy cialis cheap propecia cheap zithromax online stores viagra no rx required lasix online stores buy propecia cheap order synthroid generic cialis online viagra in malaysia cheap cialis in usa buy cheap soma