Go to Edit > Copy merged, so everything that is under the selection will be copied (in case you have a background on more than one layer) and then go to File > New. As you can see width and height has automatically the values from our copied selection. In new document go to Edit > Paste and then to File > Save As. Save the file as a background.jpg (with maximum quality - 12) in 'graf' folder from my blank template (Or in any other folder, but later on remember to change the paths in my css codes). Don't worry about the images' weights too much for now. Save everything with maximum quality and later on I will show you how to shrink them. Alright, open up index.html in your browser. It's blank. Then open up index.html in some codes editor as well as style.css. Even notepad could be, but of course there are better choices. Update html's style in css by pasting this code into it:
Now refresh your page in a browser and see the first effect. By the way, you should have some basics about html because in this tutorial you won't see deep basics about webpage creation. However I will try to explain as much as possible.
Step 15 - Coding Header
Firstly, we will need some html to work on. So let's try to separate all the elements that we have on our mock-up. A repetitive background, a non repetitive background (gradient), logo (image) and a search form. Let's try to add them. Remember to delete the html comments that are inside "" tags.
Now let's cut some images. At first we will need a guide that will separate a header from menu (Select menu shape or whole group so guide should easily stick to).
![step-015[5] step-015[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-0155.jpg.pagespeed.ce.0RV1yzJhCM.jpg)
Hide the layers with gradients so the header's background will be repetitive in x-axis (horizontally). Select few first pixels and like we did with first background image and all next images follow the standard actions: copy merged > New document > Paste > Save As (jpg or png). Save this one as a topbg.jpg.
![step-015b[5] step-015b[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-015b5.jpg.pagespeed.ce.2lJwSCGxyi.jpg)
Now select the whole top WITH gradients and save it as a topgradient.jpg
![step-015c[5] step-015c[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-015c5.jpg.pagespeed.ce.oQri_ruspZ.jpg)
Here's css for the backgrounds:
The body's background may not be displayed correctly (fully) by now for the body is as long as the header. But when we will add another components like menu and content area- it will be ok. By the way: I actually cut all the images that I will need before I will write any html and css code but herenow we'll make it step by step. Alright, next thing that we will need is a logo. Mine has a dimensions of 296 by 76 pixels and is saved as a png so the background is transparent. There were days when png format has not been supported by web browsers ( I mean IE6 ) but that was ages ago and nowadays every modern browser supports it (even animated png which isn't really popular) so you shouldn't worry about it. By the way: do you know anyone who is using IE6 by now? Just wondering, because I don't. Okay, so we have a logo, here's css for it. Html was added earlier. It was named logo.png. You can use ruler tool so you will know how far it is from top.
![step-015d[5] step-015d[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-015d5.jpg.pagespeed.ce.bK_rWjL7Zk.jpg)
Now we will need some background for search form. Hide all unneded layers and select a search form. Your selection don't have to be perfect. Notice that if you will create a new document it will apply dimensions not from the copied selection, but from the boundary of existing pixels. Name it searchbg.png. Remember, we are saving layers that has any transparency as a png. The rest is jpg.
![step-015e[5] step-015e[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-015e5.jpg.pagespeed.ce.kYkk5d-Egx.jpg)
Here, grab this code for the search form and search icon.
As you can see, the real input form is hidden.
Step 16 - Coding Main Menu
Let's start with some div-wrappers in html along with code for menu (unorganised list) and call to action button.
As you can see, in the a tag (whole button) there is a span tag which we will use to change the font of '2011' from Arial (inherited from html property in css) to Georgia. Ok, so let's go to cut some images out of psd file. We will need a whole menu shape, two backgrounds for menu items and a background for call to action button. I checked in psd that our menu is 49 pixels high- measure distance between two guides. Here are the elements that you have to cut out.
![step-016[5] step-016[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-0165.jpg.pagespeed.ce.HD7_5snBHw.jpg)
![step-016b[5] step-016b[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016b5.jpg.pagespeed.ce.wm91chgRAm.jpg)
![step-016c[5] step-016c[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016c5.jpg.pagespeed.ce.5NIfXrL-La.jpg)
Remember that we wanted to have two states of call to action button? Alright, cut out the background to the new document, but don't save it yet.
![step-016d[5] step-016d[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016d5.jpg.pagespeed.ce.WvSzQd-Qbb.jpg)
Now make a Vibrance layer (or some other adjustment layer) visible, copy merged and paste it into the previously made document (not the new one, but those with button) so you will have two layers there. Now go to Image > Canvas size, check relative checkbox and into a height type the actual height so it will double.
![step-016e[5] step-016e[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016e5.jpg.pagespeed.ce.a4btKgcC8-.jpg)
![step-016f[5] step-016f[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016f5.jpg.pagespeed.ce.6VQafJq0c6.jpg)
Move one of the layers to the bottom (it should stick to the edge) and now save it as a calltoaction.png.
![step-016g[5] step-016g[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-016g5.jpg.pagespeed.ce.OYIHbWsv9F.jpg)
Thanks to this we will make a css hover effect without an image loading delay. Alright, so the last part is css code. I believe it is self-explained, but I made few comments here and there. I used 'background-size' property (to stretch background) that was introduced in css3, so older browsers wouldn't display our menu correctly. However, we are not supporting backward compatibility. If you wish to, you have to make some hacks (or rather tricks) with stretched images and z-index. Not too hard, but too messy for this tutorial. So I will just stay with background-size which is fully supported by Opera 10+, FireFox 4+, Internet Explorer 9+, Safari 4.1+ and Chrome 3+.
Step 17 - Coding Newsletter And Footer
Great, we are pretty far. We will leave a content area for now, because firstly we'll make a blank (well, not really blank, but without a main part) html document (like we did with psd) and then we will build the content for every page. Our newsletter are will have a fixed size. Start from placing the guides on top and bottom (select newsletter gropu in layer's window so they will stick) to cut out the backgrounds.
![step-017[5] step-017[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-0175.jpg.pagespeed.ce.Z0RdI7OHLU.jpg)
Now cut out the background for wrapper, save it as newsletterbg.jpg.
![step-017b[5] step-017b[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-017b5.jpg.pagespeed.ce.orUWHYtaAC.jpg)
Check its height (or distance between guides) so you will know how big will be our newsletter area. In fact we could make it elasttic/fluid, but there is no need to do that. Now hide all the layers (with background) so you will have only an upper line (so called separator) and bottom shape. Cut it out as well. Name it newsletter.png.
![step-017c[5] step-017c[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-017c5.jpg.pagespeed.ce.JRAK0Nktu7.jpg)
Also take care about input background and newsletter icon. Here is a html code to apply.
And css for it. To fasten the work we will position everything with absolute values.
And the newsletter is complete. Let's head to the footer. We will need one image here for background and one for button (with its hover state). I resign at this moment from the contact form in the footer for we will create one in Contact page. However we will cut out the button now. Ok, cut the bottom part of gradient (name it footerbg.jpg) and create a button the same way that we have made call-to-action button (name it darkbutton.png).
![step-017d[5] step-017d[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-017d5.jpg.pagespeed.ce.7I_5DwORaf.jpg)
![step-017e[5] step-017e[5]](data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCABKAI8DASIAAhEBAxEB/8QAHAAAAQQDAQAAAAAAAAAAAAAABAABAggDBgcF/8QAQxAAAQMBAwcKAgcFCQAAAAAAAQACAwQGEZIFBxIUUVJUExchMUFTYZGT0ghzIjIzQmOhwhZlgbKzNFVxcoSxwdHw/8QAGQEBAQEBAQEAAAAAAAAAAAAAAAEEBgUC/8QAJREAAQIFAwUBAQAAAAAAAAAAAAEDAgQRFlIFFaESUWFxkSQ0/9oADAMBAAIRAxEAPwA3P9a2uqLWVORo53tydRaEfItdc2R5Y17nOH3vrAC/Ydq5QKrp+xg9Jq2nPY/RzlZcB4gf0olowkQHqCq/Bg9Jqm2q/Bg9Jq8tsnipiS5Aeq2qHcwek1TbUjuYPSavLbIsrZEKekKgdzB6TVMVA7mD0mrzWyeKm2RAH6wO5p/San1gdzBf8pqBEiXKdiAMNQO5g9Jqi6oHcwek1CGRQc/oQBTqkX/Ywek1Y3VQ7mD0moR8nXcsT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ukkSnQKGcvG1Rc8bVgLv4qJK+khKZi8X9aiXbCsRO1Npf+KqQgyl3T1rcM15vtI35Mn+7VpWl09S3LNYb7Ss+TJ+lehpifqg9nnar/ACx+iecvI1TT5dnqhE90E50w9ov6blpXIybj8KszUMZJC4SNa4bHC9DNo6bh4cAXSTmituPLEkVKnNyWuONMpAsNaFcOQk3X4UhDJ2sfhVj9TpuHhwBLU6bh4cAWbYYM+DXcDmCfSuAhk3H4U4hk3H4VY7U6bh4cAS1Om4eHAFNhgzX4Lgcw5K48k/cfhT8nIPuPwqxup03Dw4AlqdNw8OAKbDBnwLgcw5K58m+/6j8KXJv3H4VYzU6bh4cAS1Om4eHAFdgbz4FwOYcldNCTckwpFj9x+FWL1Om4eHAEtTpuHhwBTYG8+BcDmHJXPk37j8Kbk37j8KsbqdNw8OAJanTcPDgCuwN5r8FwOYclceRfuPwpci/r0H4VY7U6bh4cAS1Om4eHAFNhgzX4Lgcw5K5CF5P1H4V0XNRkaobXyV80TmQtYWNLhdpErpAo6a/+zw4AjomNYwNY0NGwC5b5HRm2XUc6q0MU/rTj7St9NKn/2Q==)
Here is html for the footer:
And complete css with some comments. As you can see I made three main blocks that stands for the columns. It is simpliest way I know to create such columns, but what's most important- it works well. With this techniqe you can make two columns as well as ten. As you can see all are floated to the left with fixed width value, so they stands next to each other.
At this moment you should get something like this and that would stand for our blank html template. Or maybe not really...
![step-017f[5] step-017f[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-017f5.jpg.pagespeed.ce.5mXm_4hTCN.jpg)
Step 18 - Coding Client Zone
Instead of making new page for login panel, we will get advantage of jquery (that is already implemented into our code) and will create a fixed div that will be hidden by default. Let's make some design at first. The form will slide from the top. It's position will be fixed and it will be stretched on 100% width of page and shouldn't be longer that the header so the user will have possibility to hide it with menu item. I kept my design simple. It's just to show off above all. Check the sources for more informations. In psd file you will find mock-up of the form, in graf folder two background images that I used here. If you wish, you can prepare your very own, more complex backgrounds. Ok, this is the html. Place it anywhere in the body tag.
![step-018[5] step-018[5]](http://photoshoptutorials.ws/images/stories/86038c839355_104BC/step-0185.jpg.pagespeed.ce.3EDdgQFTK6.jpg)
And here's css for that piece of html:
Don't forget about javascript. Place it inside head tag in your document:
And it's done. Now we can name it blank.html and make few copies of it for further pages. There won't be any additional cutting (well, maybe just a few elements actually), so the only part here is proper html and css. Download mine html sources to see it all. Hope you learned something with this tutorial and let me know if you wish to see more of that kind. See you around! Oh, I almost forgot to admit: To shrink the jpg files use IrfanView. Just open up a jpg file in this image browser and save it with 90% quality. Your image shouldn't loose a lot of quality, but it's weight could lower twice time or so. Alright, that would be all for now. Remember, when you learn html and css it is most important to analyze, analyze, analyze... Edit already created file, change some value, save, refresh and check out what's happened. It is the best way to learn.
Here's my facebook.
See you around!