From PSD to XHTML
videos

How to Convert a PSD to XHTML

I continue to be amazed by how well Collis’s “Build a Sleek Portfolio Site From Scratch” tutorial continues to perform. It’s been months, yet it still posts strong numbers every week. Considering that fact, I decided to create a screencast that shows you exactly how to convert a PSD into perfect XHTML/CSS.

Part 1: Slicing the PSD and Creating the XHTML

Part 2: CSS

I won’t lie to you. This video is a bit boring. It just isn’t fun to watch someone enter margin values for thirty minutes. :) But it’s essential.

Part 3: Implementing a Bit of Javascript

Part 4: Kicking IE6′s Butt

Could we really call ourselves web developers if we didn’t have to fight with IE6? And is it a coincidence that “6″ is also the number associated with the devil? Who knows.

Mostly, the site looks just fine in IE6, but we should change a few quirks. Create a new stylesheet and call it “ie6.css”. Place it in your CSS folder. Then paste in the following.

#container #mainContent #tier2 
{
	margin-bottom: 273px !important;
}

#tier3 #news
{
	position: relative;
	left: .56em;
}

#header 
{
height: 158px;	
}

#header #login 
{
	top: 1em;
	right: 1.5em;
}

There’s nothing that we really need to go over. Mostly, I’m adjusting the positioning of a few elements.

The last step is to reference our new stylesheet in the head tag of our document.

    <!--[if lt IE 7]>
        <link rel="stylesheet" type="text/css" href="css/ie6.css" />
    <![endif]--> 

The PSD

The PSD

The Website: 100% XHTML and CSS

The PSD

I hope this helped you. Everyone has their own way of doing things; So I’d be interested to hear your thoughts. This tutorial was a huge undertaking. I’d appreciate a Digg if you found it to be beneficial.

  • Subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.


Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Pingback: Best of the web - November 2008 | zbStudio.net

  • Jimi

    @ Andrea, you can get Visual Express for free from Dreamspark.com is you are a student ;)

  • Stoyan

    Pretty good tutorial thank you.

  • http://u.silencios.org Crystal

    I basically love you. THANKS FOR THE SCREENCAST!

  • Santosh Telwane

    CLAP CLAP CLAP
    VERY GOOD WORK.

    THANK YOU

  • http://www.antlair.com Ant-Lion

    Thanks for the video tutorials, they have been handy in helping me to learn how to turn PSD templates into XHTML templates

  • Seth

    Thats a great tutorial.
    I have a question about part 2 (CSS), im following Jeffery on a design i created. and in the Header part (where he set up the header image),i dont get the same result. what i mean is that my image dosent seem to upload.
    Everything else seems to work fine by now.
    If anyone can comment on that one ,that would be great.

  • Pingback: Pushing Photoshop to the limits 13 most advanced tutorials | Creative After Effects Tutorials and Showcase

  • KHALED

    I have learned a lot from lynda website.
    BUT THE TRUTH WITH YOU “JEF” YOU ARE THE BEST SO FAR.

    AUSTRALIA

  • saki

    Very nice to see the Tuts and Learnt a lot from it !!!!!!!!!!!!!!

  • Ahmed

    Would you Guys Digg this Tutorial please? Give something in return as well.

    This article deserves a huge traffic and I really appreciate the work of Author. Anyway I am sure Nettuts will be the first choice of every new web developer or even advance very soon. Thank you Author.

  • Meganite

    Thanks a lot for this tut! It helps me to understand, how i need to built my own site.

  • Pingback: Slice and Dice that PSD - NETTUTS

  • Pingback: In the Woods - 12 Fantastic PSD to HTML Tutorials

  • Pingback: Psd’den Html’e çevirmek için 12 kaynak | Rafet Durgut

  • http://www.tedece.com/ Tedece

    Thanks Jeffrey Way and Nettuts, you are the best !

  • Roy

    Theres no need to hack or use 2 .css files to fix IE6. Just DONT USE margin at all. :)

  • http://www.sizzlingshop.com hetalsagar

    hey i watch your tutorials its excellent and have a question like for safari and firefox you give -moz-border-radius and -webkit-border something to give rounder corner what about ie6 and ie7?.

  • http://www.jagaparajuli.com.np Kshitij Parajuli

    Thanks!
    A real BOOST to my knowledge.

  • Pingback: links for 2009-01-18 « sySolution

  • http://www.publicolombia.com iBull

    1´000.000.000 Thanks Jeffrey, Y espero que alguien lo tradusca

  • http://www.kornbrasil.com EdpeppeRs

    hey, JW!!! I love your work! haha.
    great job, man! i’m enjoying it all.. good enough!
    :D
    thank u very fucking much!

    so, it’d be interesting if we can download the screencast… :P

    hey, iBull .. do u asking to some1 put subtitles on the video, is it?

    :P

    peace, guys!!

  • D. Zioner

    This is great stuff! Dugg and bookmarked!

  • http://www.webmodia.com David | WebModia

    Jeff, I was interested when stumbled upon this. I’ve sliced hundreds of PSDs, and I agree with you that there’s always more than one way to accomplish the same task and you never know when you might learn a new trick or two from somebody doing things in a slightly different way.

    First off – hats off to you for taking the time to produce this screenshot!

    I accept your argument about not being to nitpicky (must code always validate, what makes a good class/ID name, etc) in a production environment. However, I still think you can stick to fairly strict standards-based practices while remaining fast and efficient. That said – here are a few nitpicks ;)

    1. No reason to use XHTML Transitional, as that DOCTYPE is specifically meant for “transitioning” from table-based designs with presentational elements (b, font, etc.) to semantic markup and pure CSS-based designs. For this design, you absolutely should go with the Strict DTD – be bold! :)

    2. Rather than wrapping your form labels with presentational elements like the small tag (or even a non-semantic span), you should use the HTML element specifically intended for this purpose: the label tag. This gives you the CSS hook you need, plus adds the accessibility advantages and semantics inherent with the label tag (don’t forget to use the “for” attribute).

    3. As far as I’m on the markup ;) – I would probably have kept the headers in proper order in that “news” div, using an h2 first and then h3. You can of course set the styles with CSS to have the headers display however required by the design, while keeping the hierarchy of the document outline more structural intact.

    4. As for the CSS – rather than the text-align hack for centering content, try using auto margins instead – e.g. margin:0 auto; — that along with a width declaration with effectively center a block level element within its parent container. The text-align method is really only necessary if you need to support *very old* browsers – as in IE5.x (and IE6 if you force it into quirks mode, but you shouldn’t be doing that, right?).

    5. I’d avoid using display:none; for your image replacement, as that will also render that text inaccessible to screen readers. Instead, try a more accessible method like throwing the text off screen (text-indent:-999em;, ala “Phark method). I actually prefer an even more robust method (sometimes called “Gilder/Levin”) which also works if CSS is on but images are turned off. Point is: you don’t need to sacrifice accessibility to meet design requirements like image-replaced text.

    6. Finally, I’d also recommend that you can perhaps do better with the content source order by having the #mainContent first in the markup, followed by the #sidebar. Obviously you can still control the display / layout of this content with CSS (using opposite floats, #mainCotent floated right and #sidebar floated left). This way, when the spiders (or screen readers or folks browsing without CSS) read your content, they get the most important stuff first – the actual content! – and not a long list of links.

    OK, I’m getting off the soapbox. This was a great tutorial for those just starting off, especially if they follow along with the files. You flew through the process, demonstrating quick and efficient use of CSS. I’ve been doing this a few years now and I even picked up a new trick – developing CSS in Firefox directly with the Web Developer Toolbar – that’s a great tip!

    Keep up the great work.

  • http://www.tompal.com Petar

    Dude, you are a good man

  • Munko

    Thank you very much! Very helpful tutorial, clear explained.

  • jitendra

    @David | WebModia : I agree with you

  • jitendra

    tag is a presentational tag . it should not use. style in css with class instead using this

  • http://www.sv-webdev.be Sam Vloeberghs

    Very nice tutorial!

  • http://360.yahoo.com/tienxu04 xuxu

    this tut is what I’ve been looking for for years…really enjoy your screencast. thanks for your working hard.

  • Pingback: De un PSD a XHTML « La mala memoria

  • B. K.

    great tutorial. thank you very much for taking the time to put this together. i’ve been looking for a tutorial like this for a long time. i especially found it helpful that you talked through why you were doing something, and when you made a mistake how you fixed it. so helpful.

    keep up the great work!

  • Salden Eltagonde

    Very Great tutorials..TWO THUMBS up…i can’t imagine about HaRD coding ACTION,,grrrr..super dooper believe..please me a tutorials stuff about xhtml and CSS.. im a newbies…please send me here at grindcrusties@gmail.com..representing philippines

  • bin-yasir

    That was so exciting ,,

    I was searching like this tutorial ,,

    Thx JW

  • http://www.mindxstudio.com/ mindxstudio

    Happy to learn it, thanks

  • James

    Wow man I have to applaud you. To be honest this is like the first video tutorial I ever completely watched from start to finish. I usually find myself getting bored, because the instructors jsut talk in circles. You got straight to the point and I like the fact that you even showed when you had a problem and how you went about to fix it. Most videos I try and watch, they make it seem like they are perfect and never have a problem. I learned alot more then just how to take a PSD and make it into a website. Great work man.

  • tanim

    Dear
    can i do slicing with fire works if i follow this vdo tutorial

  • nel

    jeff, do you have a screencast for xhtml and css for beginners? thank you!

  • Dmas

    have no words… excellent

  • http://www.merogdesign.blogspot.com MEROG

    Dear JW,

    A great tutorial. I am a newbie passionate to the world of creative functional website design. When I was searching for a tutorial on conversion of PSD to XHTML, your tutorial served me a feast in the mid of desert. And I need one more small help from you….

    I don’t have a good internet access at my home. I am practicing it by noting down the steps on a book in my office and implementing them at my home. So it takes too long to debug. So…

    Can you please provide me the video files, or any link to download?
    Here is my mail: merog_designer@yahoo.com

    Please JW! Awaiting your reply….//MEROG

  • JON S

    great tutorial learnt ALOT!!!

  • http://dk77.com Dan Klimke

    I’m just starting out and your tutorial has given me hope that even a noob such as I can produce a functional site based off a PSD.

  • Pingback: 43 PSD to XHTML, CSS Tutorials Creating Web Layouts And Navigation | 1stwebdesigner - Love In Design

  • http://www.honourchick.com honour chick

    thxs … very useful and easy to understand tutorial :)

  • http://www.bullshitoftheday.com sirnobull

    Another great tutorial. Thanks Jeff.

  • http://www.njedesign.com Norm

    Great tutorial. I recently created my first screen cast, and I really appreciate the time involved.

  • akobey

    nice

  • Pingback: 13 Tutorials for turning your PSD into XHTML and CSS | PSDVIBE - Tutorials and Resources

  • http://www.crazyxhtml.com Psd to Xhtml

    hmmm… very easy for understanding….

    Thanks

  • http://vodopyanov.ru/ Mike

    I can’t find a .psd file, can you send me it?
    mike@vodopyanov.ru
    Thank you a lot :-)

    • bruno

      Very nice tutorial.
      What about a CSS for Beginers screencast series?