How to Convert a Slick PSD Design to XHTML/CSS
Styling the Page
Remember how we have two different CSS files? A reset.css
and a global.css
, well we are going to work on the reset.css
file first. In this file we are going to just use the ready made availble YUI Reset 2. This will reset all of our elements in each browser to look the same.
Reset.css
The reset.css is as follows…..
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin:0; padding:0; } table { border-collapse:collapse; border-spacing:0; } fieldset,img { border:0; } address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } ol,ul { list-style:none; } caption,th { text-align:left; } h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; } q:before,q:after { content:''; } abbr,acronym { border:0; }
Base Styling
The first part of the site we want to cover is the font & base structure of the site. We are going to set a font and background for the main body of the site, eliminate the underline on link element by using text-decoration: none;
and user a basic container limiting the width to 1024px and centering it horizontally.
body { background: #F2F2F2; font: 10px Verdana; } a { text-decoration: none; } p, span { line-height: 20px; } #header, #featured, #content, #footer { overflow: hidden; } .container { margin: 0 auto; width: 1024px; } .clear { clear: both; }
Checkpoint
Your page should now look like this.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
This entry was posted on Thursday, September 16th, 2010 at 07:06 and is filed under Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Wow) this is a great tutorial!
Brilliant tutorial I will have to try it out asap.
Thanks alot ^^
Awesome Tutorial.
Thanks you for share.
Good tutorial for beginner like me, thank you 🙂
Very good tutorial, It covered a lot of things, thanks
Nice Tut 🙂
Dude, charset before title. 🙂
i’m going to have to take time on this one.thanks for sharing
Thanks you for share, great tutorial!
useful info. thanks..soon:)