How to create stretch buttons, menus, boxes with rounded corners from PSD file to HTML code?
Written by Administrator
Thursday, 29 April 2010 23:44
How to create stretch buttons, menus, boxes with rounded corners from PSD file to HTML code?
In this lesson i'll show you how to create rounded corners boxes, that can stretch down and right.
The fist sample is very easy to create. Buttons and menus usually stretch by "X" (from the left to the right).
We have PSD mockup (or image like gif, png, jpg) with button and now we have to add it to HTML:
First of all we have to create 2 background images (i use Photoshop for it). Fist image will be our stretch background, and the second will be end of the button:
I use line-height: 260% - this is for centered text by height - you can play with % value.
In next sample i will show how to create stretch box and it will be stretch by X and Y.
Here what we have to get:
ts the same what we did with stretch button background inside background, but here we will use it three times:
For the header of Box - two image (fist image stretch-box-bg.png is stretch background with length 1000px, second stretch-box-end.png is the end of our box)
For the context background (i use only one image stretch-box-content-bg.png for left and right side, because left and right side the same)
For the footer of Box (image stretch-box-btm-bg.png is stretch background with length 1000px, second stretch-box-btm-end.png is the end of our box in footer)
As you can see i used DIV with class="clr". If you remove it, you will see white spaces in top and bottom. This happen because we use tag < p > (or h1, h2, h3, ul....) all tags that have margin or padding will broke the box without DIV from top and bottom.
That is it. If you have any questions, feel free to ask me. I hope it will be helpfull